Freeze Panes in Xamarin DataGrid (SfDataGrid)
23 Sep 2020 / 1 minute to read
The SfDataGrid allows to freeze the rows and columns when scrolling the grid.
The 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:
//Setting number of rows to freeze in SfDataGrid dataGrid.FrozenRowsCount = 2;
FrozenRowsCountshould be lesser than the number of rows displayed in view. For example, If you have 10 rows in view, then you set
FrozenRowsCountto a maximum value of 9.
Header row is frozen by default and works regardless of the
The SfDataGrid also supports to freeze the columns at the left of the view by setting the SfDataGrid.FrozenColumnsCount property.
The following code example illustrates freezing two columns:
//Setting number of columns to freeze in SfDataGrid dataGrid.FrozenColumnsCount = 2;
FrozenColumnsCountshould be lesser than number of columns displayed in view. For example, If you have 5 columns in view, then you can set
FrozenColumnsCountto a maximum value of 4.
RowHeader is frozen by default and works regardless of the
The following GIF illustrates FrozenRows and FrozenColumns.