Freeze panes in Xamarin.Android SfDataGrid
24 Feb 20231 minute to read
The data grid allows freezing the rows and columns when scrolling the grid.
Freeze rows
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;
Limitation
-
FrozenRowsCount
should 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.
NOTE
The header row is frozen by default and works regardless of the
FrozenRowsCount
property.
Freeze columns
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;
Limitation
-
FrozenColumnsCount
should 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.
NOTE
The row header is frozen by default and works regardless of the
FrozenColumnsCount
property.