Home › Forums › WinForms controls › Xceed Grid for WinForms › Scrollbar.visible?
-
AuthorPosts
-
#13911 |
How could I find out whether a scrollbar is currently visible? I set it to display only if necessary but could not find a property “.visible” or else….?
Imported from legacy forums. Posted by Kai (had 4396 views)
I think it’s an enumerator on the Grid.Scrollbars property… so something like this….
if(Grid.Scrollbars == ScrollBars.Vertical)
{
//vertical scrollbar is visible
}I’m pretty new to the object model myself but that’s how I’m doing it atm
Imported from legacy forums. Posted by AndyJ (had 385 views)
sorry it’s this goofed on the code heh
if(Grid.Scrollbars == GridScrollBars.Vertical)
{
//vertical scrollbar is visible
}Imported from legacy forums. Posted by AndyJ (had 624 views)
Hi Andy,
thanks for your response, but GridScrollBars.Vertical only displays the scrollbar if necessary. So if there is not enough content and no scrolling is necessary the scrollbar is not displayed even though the .vertical option is set. Checking this option unfortunately does not fix the problem… And I don’t want to use .ForcedVertical if it’s not necessary to display the scrollbar.
Imported from legacy forums. Posted by Kai (had 472 views)
I don’t know of any property or method to determine this. Maybe you could calculate it: if the sum of the heights of all the (visible) rows > the height of the GridControl, then there will probably be a vertical scrollbar.
Imported from legacy forums. Posted by Tommy (had 339 views)
🙁 OK, thanks for the info. So I will use .forcedvertical in the meantime so it’s always displayed. If the users complain I might use your tip (even though I currently don’t know if it’s possible to find out the height of each rows if a datarow is expanded on several grid rows…. It’s not just counting the rows but also calculating how many (grid-)rows a single (data-)row needs for display 😐 )
Imported from legacy forums. Posted by Kai (had 5063 views)
-
AuthorPosts
- You must be logged in to reply to this topic.