C1TrueDBGrid Determine if scrollbars are being displayed

Posted by: SHanau on 18 July 2020, 2:59 am EST

  • Posted 18 July 2020, 2:59 am EST

    Hi,

    I'm working with a fixed grid width and the ExtendRightColumn property of C1TrueDBGrid. In some of my grids the caption of the right-most column isn't clearly visible because of the vertical scrollbar blocking the view. So I want to determine whether the scrollbars are currently being displayed in order to reduce one of the grid's other columns width by the width of the scrollbar to have the right-most column in full width.

    So, Is there a method or an event around to determine whether C1TrueDbGrid's scrollbars are currently being displayed ?

    Thanks in advance,
    Stephan
  • Marked as Answer

    Replied 19 July 2020, 4:37 pm EST

    Hi Stephan,

    You can use the Visible property of VScrollBar to know that vertical scrollbar are currently visible or not as given in code snippet below:

    Console.WriteLine(c1TrueDBGrid1.VScrollBar.Visible);


    You can use the SizeChanged event of TrueDBGrid to determine the visibility of the Vertical scrollbar when changing the size of the grid at runtime.
    https://www.grapecity.com/componentone/docs/win/online-truedbgrid/C1.Win.C1TrueDBGrid.4.5.2~C1.Win.C1TrueDBGrid.C1TrueDBGrid~SizeChanged_EV.html?highlight=sizechanged%2C

    If you need any other help, please let us know.

    Regards,
    Prabhat Sharma.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels