Home Forums WinForms controls Xceed Grid for WinForms Scrollbar.visible?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #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)

    User (Old forums)
    Member
    Post count: 23064

    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)

    User (Old forums)
    Member
    Post count: 23064

    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)

    User (Old forums)
    Member
    Post count: 23064

    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)

    User (Old forums)
    Member
    Post count: 23064

    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)

    User (Old forums)
    Member
    Post count: 23064

    🙁 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)

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.