23 Sep 2020 / 1 minute to read
The data grid allows freezing the rows and columns when scrolling the grid.
The data grid extensively supports freezing the rows at the top of the view and below the header row by setting the SfDataGrid.FrozenRowsCount property.
The following code example illustrates freezing two rows in the data grid.
//Setting number of rows to freeze in SfDataGrid dataGrid.FrozenRowsCount = 2;
FrozenRowsCountshould be less than the number of rows that is displayed in the view.
For example: If you have 10 rows in view, set
FrozenRowsCount to a maximum value of 9.
The header row is frozen by default and works regardless of the
The data grid also supports freezing the columns on the left of the view by setting the SfDataGrid.FrozenColumnsCount property.
The following code example illustrates freezing two columns in the data grid.
//Setting number of columns to freeze in SfDataGrid dataGrid.FrozenColumnsCount = 2;
FrozenColumnsCountshould be less than the number of columns displayed in the view.
For example: If you have 5 columns in view, set
FrozenColumnsCount to a maximum value of 4.
The row header is frozen by default and works regardless of the