We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Horizontal/Vertical scroll in grid

Hi,

How can I check if a GridControl has a scrollbar? Can I check this on the fly, even when I scale my application (so the GridControl is scaled too)? Thanks!

Tim.


1 Reply

AD Administrator Syncfusion Team March 6, 2008 04:18 AM UTC

Hi Tim.,

If your intention is to fill the grid without showing a scrollbar and scale the application (GridControl too without the scrollbar), it can be achieved by using GridQueryColWidth.
The following code snippet shows how you can use GridQueryColWidth so that the grid is fill without showing the scrollbar.


protected virtual void GridQueryColWidth(object sender, GridRowColSizeEventArgs e)
{
if (this.fillLastColumn && e.Index == Grid.ColCount)
{
int width = Grid.ColCount <= 0 ? 0 : Grid.ColWidths.GetTotal(0, Grid.ColCount-1);
e.Size = Grid.ClientRectangle.Width-width;
e.Handled = true;
}
}


Please refer the following forum link that discuss about the grid without the scrollbar.

http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=2699

http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=3592

Please let me know if this is not what you needed.

Regards,
Asem.




Loader.
Live Chat Icon For mobile
Up arrow icon