How to make SfDataGrid scroll like an excel sheet?
SfDataGrid provides three types of scrolling mode which can be customized using the SfDataGrid.ScrollingMode property. By default, the SfDataGrid will scroll its content based on pixel values.
- PixelLine
- Line
- Pixel
PixelLine
When SfDataGrid.ScrollingMode is PixelLine, the SfDataGrid will scroll its contents like an excel sheet. i.e., whenever a row or a column is clipped on the top, the particular row or column will be auto scrolled to display fully in view.
SfDataGrid sfGrid; sfGrid = new SfDataGrid(); sfGrid.ScrollingMode = ScrollingMode.PixelLine;
Line Scrolling
When SfDataGrid.ScrollingMode is Line, the SfDataGrid will scroll its contents based on lines. i.e., the view will be updated only when the offset values reaches the origin of a row or column in the bound collection.
SfDataGrid sfGrid; sfGrid = new SfDataGrid(); sfGrid.ScrollingMode = ScrollingMode.Line;
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
|
|
| |
|
|
| |
|
|
|
|
Pixel Scrolling
When SfDataGrid.ScrollingMode is Pixel, the SfDataGrid will scroll its contents based on pixel values. i.e., the view will be updated each pixel change of the offsets and rows or columns will appear clipped when offset exceeds the origin of the row or column.
SfDataGrid sfGrid; sfGrid = new SfDataGrid(); sfGrid.ScrollingMode = ScrollingMode.Pixel;