Freeze panes
18 Nov 2018 / 1 minute to read
SfDataGrid allows you to freeze the rows and columns when scrolling the grid.
Freeze Rows
SfDataGrid provides extensive support to freeze the rows at the top of the view below the header row by setting the SfDataGrid.FrozenRowsCount property.
The following code example illustrates freezing two rows in SfDataGrid.
//Setting number of rows to freeze in SfDataGrid
dataGrid.FrozenRowsCount = 2;
Limitation
-
FrozenRowsCount
should be lesser than the number of rows that is displayed in View. - For example:
If you have 10 rows in view, then you setFrozenRowsCount
to a maximum value of 9.
NOTE
Header row is frozen by default and works regardless of the
FrozenRowsCount
property.
Freeze Columns
SfDataGrid also provides support to freeze the columns at the left of the view by setting the SfDataGrid.FrozenColumnsCount property.
The following code example illustrates freezing two columns in SfDataGrid.
//Setting number of columns to freeze in SfDataGrid
dataGrid.FrozenColumnsCount = 2;
Limitation
-
FrozenColumnsCount
should be lesser than number of columns displayed in View. - For example:
If you have 5 columns in view, then you can setFrozenColumnsCount
to a maximum value of 4.
NOTE
RowHeader is frozen by default and works regardless of the
FrozenColumnsCount
property.
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page