This documentation topic describes legacy technology. We no longer develop new functionality for the GridControl and suggest that you use the new DataGridView control instead.
GridControl allows you to anchor (fix) columns to the left or right edge, so they are not horizontally scrolled with the grid. This can be useful when columns should always be displayed onscreen, regardless of scrolling.
Using horizontal scrolling only makes sense when the auto-column width feature is disabled (that is when the GridControl.ColumnsAutoWidth property is set to false) and the total width of columns exceeds the grid's width. Otherwise, fixed columns and horizontal scrolling are disabled.
On the image below, the Photo and Name columns are fixed to the left and the Total column is fixed to the right.
Unfixed columns can be horizontally scrolled by end-users. Also, you can scroll a grid from the code using the GridControl.HorizontalScrollOffset property. It allows you to set (or get) a scrolling offset for the grid. The code below sets the Position column's width as a scrolling offset.
grid.HorizontalScrollOffset = grid.Columns["Position"].Width;
To speed up the grid's performance, enable the GridControl.AllowHorizontalScrollingVirtualization option. If this option is enabled, a grid renders only those columns that are displayed onscreen. Each time a grid is horizontally scrolled, visible (displayed onscreen) columns are rendered again. Otherwise, if the AllowHorizontalScrollingVirtualization property is set to false, the grid renders all columns.
We are updating the DevExpress product documentation website and this page is part of our new experience. During this transition period, product documentation remains available in our previous format at documentation.devexpress.com. Learn More...
Was this page helpful?
Thanks for your feedback! Any other suggestions? Tell us here.