Migrate from Xamarin.Forms SfDataGrid to .NET MAUI SfDataGrid
13 Dec 20246 minutes to read
To make migration from Xamarin SfDataGrid to .NET MAUI SfDataGrid easier, we kept most of the APIs from Xamarin SfDataGrid in MAUI SfDataGrid. However, to maintain the consistency of API naming in MAUI SfDataGrid, we renamed some of the APIs. The APIs that have been changed in MAUI SfDataGrid from Xamarin SfDataGrid are detailed as follows.
Namespaces
Xamarin SfDataGrid | .NET MAUI SfDataGrid |
---|---|
Syncfusion.SfDataGrid.XForms | Syncfusion.Maui.DataGrid |
Syncfusion.Data | Syncfusion.Maui.Data |
Syncfusion.SfDataGrid.XForms.DataPager | Syncfusion.Maui.DataGrid.DataPager |
Enums
Xamarin SfDataGrid | .NET MAUI SfDataGrid | Description |
---|---|---|
Defines constants that specify how the columns in a are sized. | ||
Defines the constants that specifies how the sorting is applied. | ||
Defines the constants that specify whether the table summary row is positioned at the top or bottom of the DataGrid. | ||
Defines the constants that describes the possible ellipsis modes for the NumericButton. | ||
Defines the constant that specify the shape of the buttons in the data pager. | ||
Defines the constants that specify whether the numeric buttons should be generated automatically based on parent size or manually using the specified NumericButtonCount value. | ||
Defines the possible display mode of SfDataPager. | ||
Defines constants that specify the possible progressing states of resizing operation. | ||
Defines constants that specify the possible progressing states of resizing operation. | ||
Defines the constants that specifies how the selection is applied. | ||
Defines constants that specifies whether the swipe view content should be auto sized or not. | ||
Defines constants that specify the swipe directions. |
Properties
Xamarin SfDataGrid | .NET MAUI SfDataGrid | Description |
---|---|---|
Defines constants that specify how the columns in a are sized. | ||
Specifies that the single column alone can be sorted at a time. | ||
Specifies that the multiple columns can be sorted. | ||
Defines the constants that specifies how the sorting is applied. | ||
Gets or sets a value indicating whether a column should be visible. | ||
Gets or sets a row which is currently selected. | ||
Gets or sets the collection of rows which are all selected. | ||
Gets or sets a row which is currently navigated. | ||
Gets or sets the background for the header row. | ||
Gets or sets the background of the data rows. | ||
Gets or sets the text color of the data row. | ||
Gets or sets the text color of the header row. | ||
Gets or sets the color for the grid lines. | ||
Gets or sets the stroke thickness of the grid lines. | ||
Gets or sets the background of the selected rows. | ||
Gets or sets the text color of the selected rows. | ||
Gets or sets the value that indicates how all the columns widths are determined. | ||
Gets or sets the font attributes. | ||
Gets or sets the font family. | ||
Gets or sets the font attributes. | ||
Gets or sets the font family. | ||
The number of non-scrolling rows at the top of SfDataGrid. | ||
The number of non-scrolling columns at the left side of SfDataGrid. | ||
This enables users to customize the appearance of the data pager. | ||
This enables users to customize the selection background color for numeric button. | ||
This enables users to customize the background color of the SfDataPager. | ||
This enables users to customize the icon color of the navigation buttons. | ||
This enables users to customize the text color of the numeric values in the navigation buttons. | ||
This enables users to customize the text color of the currently selected numeric button in the view. | ||
- | This property isn't available because the [UseOnDemandPaging](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.DataPager.SfDataPager.html#Syncfusion_Maui_DataGrid_DataPager_SfDataPager_UseOnDemandPaging) property alone is sufficient to enable on-demand paging in the MAUI DataGrid. | |
This enables users to resize the columns by tapping and dragging the right border of the column headers. | ||
This enables users to get the column dragging details as a `DataGridDragAction`. | ||
This enables users to change the color of the column drag view text color. |
Events
Xamarin SfDataGrid | .NET MAUI SfDataGrid | Description |
---|---|---|
Occurs when the cell is tapped. | ||
Occurs when the cell is tapped. | ||
Occurs when the cell is tapped twice. | ||
Occurs when the cell is tapped twice. | ||
Occurs when the cell is long pressed for particular period. | ||
Occurs when the cell is long pressed for particular period. | ||
- | This event is not available in MAUI DataGrid. You can write the custom style for
TargetType. By writing the converter, you can achieve the requirement conditionally. Refer UG documentation for more information. |
|
- | This event is not available in MAUI DataGrid. You can write the custom style for
TargetType. By writing the converter, you can achieve the requirement conditionally. Refer UG documentation for more information. |
|
Occurs when page index is being changed. | ||
Occurs when page index is changed. | ||
Occurs when the View is created. | ||
Occurs when the components in the SfDataGrid initialized and rendered. |
Methods
Xamarin SfDataGrid | .NET MAUI SfDataGrid | Description |
---|---|---|
Gets the row height to fit that row based on the content. We have passed the optional parameters such as and where as we have not provided the class as parameters. |
Classes
Xamarin SfDataGrid | .NET MAUI SfDataGrid | Description |
---|---|---|
Represents the base class for the different column types of the control. | ||
A column which is used to handle the numeric values. | ||
A column which is used to show any type of System.DateTime. | ||
A column which is used to show any type of ImageSource. | ||
A column which is used to show any type of template. | ||
Represents a column that hosts textual Content in its cells. | ||
Represents a record cell in a control. | ||
Represents a record row in a control. | ||
Represents a header cell in a control | ||
Represents a class that handles the sizing for all the in the Columns collection in a control. | ||
Represents a class that defines the summary information of summary row. | ||
Represents a class that defines summary information of table summary row in . | ||
Defines the constants that specify whether the table summary row is positioned at the top or bottom of the control. | ||
Represents a table summary row in a control. | ||
Represents a column that is stacked across the specified child columns in it. | ||
Represents a in a control. | ||
A class for cell renderer that displays in a . | ||
The contains the collection of to be grouped under a particular category.}}. | ||
Represents a as a control in a control. | ||
Represents a as a control to add additional rows in a control. | ||
Represents a as a control to add additional columns in a control. | ||
Represents a class that enables users to customize the appearance of the data pager. | ||
Represents a datagrid column resizing event args. | ||
Represents a datagrid column drag and drop event args. | ||
Represents a datagrid swipe starting event args. | ||
Represents a datagrid swiping event args. | ||
Represents a datagrid swipe ended event args. |
Known issues
-
[Android] Horizontal scrolling performance is not smooth in the Debug solution configuration when compared to Xamarin.Forms SfDataGrid. However, the scrolling performance is smooth when the solution configuration is Release.
-
[Windows] Swiping and Row Drag-and-Drop using the touchscreen are not working.
Upcoming Features
- Custom selection