Class SfDataGrid
A data bound grid control that displays the data from data source in a tabular view. The SfDataGrid control allows you to display different types of columns, sort and select the rows.
Implements
Inherited Members
Namespace: Syncfusion.Maui.DataGrid
Assembly: Syncfusion.Maui.DataGrid.dll
Syntax
public class SfDataGrid : SfView, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IVisualTreeElement, ISemanticsProvider, IParentThemeElement, IThemeElement, IPullToRefresh, IDetailsViewNotifier
Remarks
To bind the SfDataGrid to data, set the ItemsSource property to an System.Collections.IEnumerable implementation. Each row in the data grid is bound to an object in the data source, and each column in the data grid is bound to a property of the data object. In order for the SfDataGrid user interface to update automatically when items are added to or removed from the source data, the SfDataGrid must be bound to a collection that implements the System.Collections.Specialized.INotifyCollectionChanged interface, such as an System.Collections.ObjectModel.ObservableCollection<>. To automatically reflect property changes, the objects in the source collection must implement the System.ComponentModel.INotifyPropertyChanged interface.
Constructors
SfDataGrid()
Initializes a new instance of the SfDataGrid class.
Declaration
public SfDataGrid()
Fields
AddNewRowPositionProperty
The position where the add new row is displayed in the DataGrid. Identifies the SelectionMode Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty AddNewRowPositionProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
AddNewRowTextProperty
The text shown for the add new row prompt.
Declaration
public static readonly BindableProperty AddNewRowTextProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
AllowAsyncScrollingProperty
Identifies the AllowAsyncScrolling Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty AllowAsyncScrollingProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
AllowColumnSelectionProperty
Identifies the AllowColumnSelection bindable property.
Declaration
public static readonly BindableProperty AllowColumnSelectionProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
The AllowColumnSelection property determines the Column Selection of the SfDataGrid.
AllowDeletingProperty
Bindable property for AllowDeleting
Declaration
public static readonly BindableProperty AllowDeletingProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
AllowDiagonalScrollingProperty
Identifies the AllowDiagonalScrolling Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty AllowDiagonalScrollingProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
The AllowDiagonalScrollingProperty determines whether diagonal scrolling is allowed in the SfDataGrid.
By default, diagonal scrolling is enabled. When set to false, users can only scroll either horizontally or vertically at a time.
AllowDraggingColumnProperty
Identifies the AllowDraggingColumn Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty AllowDraggingColumnProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
AllowDraggingRowProperty
Bindable property for AllowDraggingRow.
Declaration
public static readonly BindableProperty AllowDraggingRowProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
AllowEditingProperty
Identifies the AllowEditing Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty AllowEditingProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
AllowGroupExpandCollapseProperty
to do
Declaration
public static readonly BindableProperty AllowGroupExpandCollapseProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
AllowKeyboardNavigationProperty
Bindable property for AllowKeyboardNavigation
Declaration
public static readonly BindableProperty AllowKeyboardNavigationProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
AllowLoadMoreProperty
Identifies the AllowLoadMore Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty AllowLoadMoreProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
AllowPullToRefreshProperty
Declaration
public static readonly BindableProperty AllowPullToRefreshProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
AllowResizingColumnsProperty
Identifies the AllowResizingColumns Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty AllowResizingColumnsProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
AllowRowHoverHighlightingProperty
Identifies the AllowRowHoverHighlighting bindable property.
Declaration
public static readonly BindableProperty AllowRowHoverHighlightingProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
AllowSwipingProperty
Identifies the AllowSwiping bindable property.
Declaration
public static readonly BindableProperty AllowSwipingProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
The AllowSwiping property controls whether swiping is enabled on the rows of the SfDataGrid.
AllowTriStateSortingProperty
Identifies the AllowTriStateSorting Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty AllowTriStateSortingProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
AlternationRowCountProperty
Identifies the AlternationRowCount Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty AlternationRowCountProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
AutoExpandGroupsProperty
to do
Declaration
public static readonly BindableProperty AutoExpandGroupsProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
AutoGenerateColumnsModeForCustomTypeProperty
Identifies the AutoGenerateColumnsModeForCustomType Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty AutoGenerateColumnsModeForCustomTypeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
AutoGenerateColumnsModeProperty
Identifies the AutoGenerateColumnsMode Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty AutoGenerateColumnsModeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
AutoGenerateRelationsProperty
Identifies the AutoGenerateRelations bindable property.
Declaration
public static readonly BindableProperty AutoGenerateRelationsProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CanMaintainScrollPositionProperty
Identifies theCanMaintainScrollPosition Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty CanMaintainScrollPositionProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
CanUseViewFilterProperty
Bindable property for CanUseViewFilter
Declaration
public static readonly BindableProperty CanUseViewFilterProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CaptionSummaryRowProperty
to do
Declaration
public static readonly BindableProperty CaptionSummaryRowProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CaptionSummaryTemplateProperty
Bindable property for CaptionSummaryTemplate
Declaration
public static readonly BindableProperty CaptionSummaryTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CellDoubleTappedCommandParameterProperty
Bindable property for CellDoubleTappedCommandParameter
Declaration
public static readonly BindableProperty CellDoubleTappedCommandParameterProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CellDoubleTappedCommandProperty
Bindable property for CellDoubleTappedCommand
Declaration
public static readonly BindableProperty CellDoubleTappedCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CellEnteredCommandParameterProperty
Bindable property for CellEnteredCommandParameter
Declaration
public static readonly BindableProperty CellEnteredCommandParameterProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CellEnteredCommandProperty
Bindable property for CellEnteredCommand
Declaration
public static readonly BindableProperty CellEnteredCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CellExitedCommandParameterProperty
Bindable property for CellExitedCommandParameter
Declaration
public static readonly BindableProperty CellExitedCommandParameterProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CellExitedCommandProperty
Bindable property for CellExitedCommand
Declaration
public static readonly BindableProperty CellExitedCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CellHoveredCommandParameterProperty
Bindable property for CellHoveredCommandParameter
Declaration
public static readonly BindableProperty CellHoveredCommandParameterProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CellHoveredCommandProperty
Bindable property for CellHoveredCommand
Declaration
public static readonly BindableProperty CellHoveredCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CellLongPressCommandParameterProperty
Bindable property for CellLongPressCommandParameter
Declaration
public static readonly BindableProperty CellLongPressCommandParameterProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CellLongPressCommandProperty
Bindable property for CellLongPressCommand
Declaration
public static readonly BindableProperty CellLongPressCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CellRenderersProperty
Identifies the CellRenderers Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty CellRenderersProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
CellRightTappedCommandParameterProperty
Bindable property for CellRightTappedCommandParameter
Declaration
public static readonly BindableProperty CellRightTappedCommandParameterProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CellRightTappedCommandProperty
Bindable property for CellRightTappedCommand
Declaration
public static readonly BindableProperty CellRightTappedCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CellTappedCommandParameterProperty
Bindable property for CellTappedCommandParameter
Declaration
public static readonly BindableProperty CellTappedCommandParameterProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CellTappedCommandProperty
Bindable property for CellTappedCommand
Declaration
public static readonly BindableProperty CellTappedCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ColumnDragDropTemplateProperty
Identifies the ColumnDragDropTemplate Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ColumnDragDropTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ColumnsProperty
Identifies the Columns Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ColumnsProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
ColumnWidthModeProperty
Identifies the ColumnWidthMode Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ColumnWidthModeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
CopyOptionProperty
Identifies the CopyOption bindable property.
Declaration
public static readonly BindableProperty CopyOptionProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CopyPasteControllerProperty
Identifies the
Declaration
public static readonly BindableProperty CopyPasteControllerProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CurrentCellManagerProperty
Bindable property for CurrentCellManager
Declaration
public static readonly BindableProperty CurrentCellManagerProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
CurrentCellProperty
Identifies the CurrentCell Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty CurrentCellProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
CurrentRowProperty
Identifies the CurrentRow Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty CurrentRowProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
DataFetchSizeProperty
Bindable property of DataFetchSize
Declaration
public static readonly BindableProperty DataFetchSizeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
DataGridValidationModeProperty
Identifies the ValidationMode bindable property.
Declaration
public static readonly BindableProperty DataGridValidationModeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
DefaultColumnWidthProperty
Identifies the DefaultColumnWidth Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty DefaultColumnWidthProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
DefaultStyleProperty
Identifies the DefaultStyle Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty DefaultStyleProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
DetailsViewDefaultStyleProperty
Identifies the
Declaration
public static readonly BindableProperty DetailsViewDefaultStyleProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
DetailsViewDefinitionProperty
Identifies the DetailsViewDefinition bindable property.
Declaration
public static readonly BindableProperty DetailsViewDefinitionProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
DetailsViewPaddingProperty
Identifies the DetailsViewPadding bindable property.
Declaration
public static readonly BindableProperty DetailsViewPaddingProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
EditTapActionProperty
Identifies the AllowEditing Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty EditTapActionProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
EmptyViewProperty
Bindable property for EmptyView.
Declaration
public static readonly BindableProperty EmptyViewProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
EmptyViewTemplateProperty
Bindable property for EmptyViewTemplate.
Declaration
public static readonly BindableProperty EmptyViewTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
EnableDataVirtualizationProperty
Bindable Property for EnableDataVirtualization
Declaration
public static readonly BindableProperty EnableDataVirtualizationProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ErrorIconTemplateProperty
Identifies the ErrorIconTemplate Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ErrorIconTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ErrorTipTemplateProperty
Identifies the ErrorTipTemplate Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ErrorTipTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ExpanderColumnWidthProperty
Identifies the ExpanderColumnWidth dependency property.
Declaration
public static readonly BindableProperty ExpanderColumnWidthProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
FilterRowCellRenderersProperty
Identifies the FilterCellRenderer Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty FilterRowCellRenderersProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
FilterRowPositionProperty
Identifies the FilterRowPosition bindable property.
Declaration
public static readonly BindableProperty FilterRowPositionProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
The FilterRowPosition property determines the position of the filter row in the SfDataGrid.
FrozenColumnCountProperty
Identifies the FrozenColumnCount Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty FrozenColumnCountProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
FrozenRowCountProperty
Identifies the FrozenRowCount Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty FrozenRowCountProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
GridLinesVisibilityProperty
Identifies the GridLinesVisibility Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty GridLinesVisibilityProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
GroupCaptionContextMenuProperty
Identifies the GroupCaptionContextMenu bindable property.
Declaration
public static readonly BindableProperty GroupCaptionContextMenuProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
GroupCaptionTextFormatProperty
to do
Declaration
public static readonly BindableProperty GroupCaptionTextFormatProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
GroupColumnDescriptionsProperty
to do
Declaration
public static readonly BindableProperty GroupColumnDescriptionsProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
GroupExpandCollapseTemplateProperty
Identifies the GroupExpandCollapseTemplate
Declaration
public static readonly BindableProperty GroupExpandCollapseTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
GroupingModeProperty
to do
Declaration
public static readonly BindableProperty GroupingModeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
GroupSummaryContextMenuProperty
Identifies the GroupSummaryContextMenu bindable property.
Declaration
public static readonly BindableProperty GroupSummaryContextMenuProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
GroupSummaryRowsProperty
Declaration
public static readonly BindableProperty GroupSummaryRowsProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
GroupSummaryTemplateProperty
Declaration
public static readonly BindableProperty GroupSummaryTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
HeaderContextMenuProperty
Identifies the HeaderContextMenu bindable property.
Declaration
public static readonly BindableProperty HeaderContextMenuProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
HeaderGridLinesVisibilityProperty
Identifies the HeaderGridLinesVisibility Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty HeaderGridLinesVisibilityProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
HeaderRowHeightProperty
Identifies the HeaderRowHeight Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty HeaderRowHeightProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
HideEmptyDataGridViewDefinitionProperty
Identifies the HideEmptyDataGridViewDefinition bindable property.
Declaration
public static readonly BindableProperty HideEmptyDataGridViewDefinitionProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
HorizontalScrollBarVisibilityProperty
Identifies the HorizontalScrollBarVisibility Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty HorizontalScrollBarVisibilityProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
IndentColumnWidthProperty
to do
Declaration
public static readonly BindableProperty IndentColumnWidthProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
IsBusyProperty
Identifies the IsBusy Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty IsBusyProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
ItemsSourceProperty
Identifies the ItemsSource Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ItemsSourceProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
LeftSwipeTemplateProperty
Identifies the LeftSwipeTemplate bindable property.
Declaration
public static readonly BindableProperty LeftSwipeTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
The LeftSwipeTemplate property defines the content displayed when a row is swiped from left to right in the SfDataGrid.
LiveDataUpdateModeProperty
Declaration
public static readonly BindableProperty LiveDataUpdateModeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
LoadMoreCommandProperty
Identifies the LoadMoreCommand Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty LoadMoreCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
LoadMorePositionProperty
Identifies the LoadMorePosition Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty LoadMorePositionProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
LoadMoreViewProperty
Identifies the LoadMoreView Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty LoadMoreViewProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
LostFocusBehaviorProperty
Bindable property for LostFocusBehavior
Declaration
public static readonly BindableProperty LostFocusBehaviorProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
MaxSwipeOffsetProperty
Identifies the MaxSwipeOffset bindable property.
Declaration
public static readonly BindableProperty MaxSwipeOffsetProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
The MaxSwipeOffset property defines the maximum distance that a row can be swiped before the swipe action is considered complete.
NavigationModeProperty
Identifies the NavigationMode Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty NavigationModeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
NewItemPlaceholderPositionProperty
Sets the position of the new item placeholder in the DataGrid.
Declaration
public static readonly BindableProperty NewItemPlaceholderPositionProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
NotifyEventsToParentDataGridProperty
Identifies the NotifyEventsToParentDataGrid bindable property.
Declaration
public static readonly BindableProperty NotifyEventsToParentDataGridProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
PasteOptionProperty
s Identifies the PasteOption bindable property.
Declaration
public static readonly BindableProperty PasteOptionProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
PullToRefreshCommandProperty
Declaration
public static readonly BindableProperty PullToRefreshCommandProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
RecordContextMenuProperty
Identifies the RecordContextMenu bindable property.
Declaration
public static readonly BindableProperty RecordContextMenuProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ReuseRowsOnItemsSourceChangeProperty
Bindable property for ReuseRowsOnItemsSourceChange
Declaration
public static readonly BindableProperty ReuseRowsOnItemsSourceChangeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
RightSwipeTemplateProperty
Identifies the RightSwipeTemplate bindable property.
Declaration
public static readonly BindableProperty RightSwipeTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
The RightSwipeTemplate property defines the content displayed when a row is swiped from right to left in the SfDataGrid.
RowDragDropTemplateProperty
Identifies the RowDragDropTemplate Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty RowDragDropTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
RowHeaderTemplateProperty
Bindable property for RowHeaderTemplate
Declaration
public static readonly BindableProperty RowHeaderTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
RowHeaderWidthProperty
Bindable property for RowHeaderWidth
Declaration
public static readonly BindableProperty RowHeaderWidthProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
RowHeightProperty
Identifies the RowHeight Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty RowHeightProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
ScrollingModeProperty
Identifies the ScrollingMode bindable property.
Declaration
public static readonly BindableProperty ScrollingModeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
SelectedDetailsViewGridProperty
Identifies the SelectedDetailsViewDataGrid bindable property.
Declaration
public static readonly BindableProperty SelectedDetailsViewGridProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
SelectedIndexProperty
Identifies the SelectedIndex Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty SelectedIndexProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
SelectedRowProperty
Identifies the SelectedRow Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty SelectedRowProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
SelectedRowsProperty
Identifies the SelectedRows Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty SelectedRowsProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
SelectionControllerProperty
Bindable property for SelectionController
Declaration
public static readonly BindableProperty SelectionControllerProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
SelectionModeProperty
Identifies the SelectionMode Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty SelectionModeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
SelectionUnitProperty
Identifies the SelectionUnit Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty SelectionUnitProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShowColumnWhenGroupedProperty
to do
Declaration
public static readonly BindableProperty ShowColumnWhenGroupedProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShowDetailsViewIndentCellProperty
Identifies the ShowDetailsViewIndentCell bindable property.
Declaration
public static readonly BindableProperty ShowDetailsViewIndentCellProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShowRowHeaderProperty
Bindable property for ShowRowHeader
Declaration
public static readonly BindableProperty ShowRowHeaderProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ShowSortNumbersProperty
Identifies the ShowSortNumbers Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ShowSortNumbersProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
ShowToolTipProperty
Identifies the ShowToolTip bindable property.
Declaration
public static readonly BindableProperty ShowToolTipProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
SortColumnDescriptionsProperty
Identifies the SortColumnDescriptionCollection Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty SortColumnDescriptionsProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
SortComparersProperty
Identifies the SortComparers Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty SortComparersProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
SortIconTemplateProperty
Identifies the SortIconTemplate.
Declaration
public static readonly BindableProperty SortIconTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
SortingGestureTypeProperty
Identifies the SortingGestureType Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty SortingGestureTypeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
SortingModeProperty
Identifies the SortingMode Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty SortingModeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
SourceTypeProperty
Bindable property for SourceType
Declaration
public static readonly BindableProperty SourceTypeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
StackedHeaderRowsProperty
to do
Declaration
public static readonly BindableProperty StackedHeaderRowsProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
SummaryCalculationModeProperty
Declaration
public static readonly BindableProperty SummaryCalculationModeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
SwipeOffsetModeProperty
Identifies the SwipeOffsetMode bindable property.
Declaration
public static readonly BindableProperty SwipeOffsetModeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
The SwipeOffsetMode property determines how the swipe threshold is calculated, either using a predefined value or the width of the swipe view's content.
TableSummaryContextMenuProperty
Identifies the TableSummaryContextMenu bindable property.
Declaration
public static readonly BindableProperty TableSummaryContextMenuProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
TableSummaryRowsProperty
Declaration
public static readonly BindableProperty TableSummaryRowsProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
TableSummaryTemplateProperty
Declaration
public static readonly BindableProperty TableSummaryTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ToolTipTemplateProperty
Identifies the ToolTipTemplate Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ToolTipTemplateProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
TransitionTypeProperty
Bindable property for TransitionType
Declaration
public static readonly BindableProperty TransitionTypeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
UnboundRowProperty
to do
Declaration
public static readonly BindableProperty UnboundRowProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
VerticalOverScrollModeProperty
Identifies the VerticalOverScrollMode Microsoft.Maui.Controls.BindableProperty
Declaration
public static readonly BindableProperty VerticalOverScrollModeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
VerticalScrollBarVisibilityProperty
Identifies the VerticalScrollBarVisibility Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty VerticalScrollBarVisibilityProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
ViewProperty
Identifies the View Microsoft.Maui.Controls.BindableProperty.
Declaration
public static readonly BindableProperty ViewProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
Properties
AddNewRowController
Gets or sets the instance of DataGridAddNewRowController that manages the AddNewRow functionality for the data grid.
Declaration
public DataGridAddNewRowController AddNewRowController { get; set; }
Property Value
| Type |
|---|
| DataGridAddNewRowController |
AddNewRowPosition
Gets or sets the position of the add new row.
Declaration
public DataGridAddNewRowPosition AddNewRowPosition { get; set; }
Property Value
| Type |
|---|
| DataGridAddNewRowPosition |
AddNewRowText
Gets or sets the text displayed for the add new row. Returns a default string if the property is unset or empty.
Declaration
public string AddNewRowText { get; set; }
Property Value
| Type |
|---|
| System.String |
AllowAsyncScrolling
Gets or sets a value indicating whether asynchronous scrolling is enabled in the SfDataGrid. This is a bindable property.
Declaration
[Cloneable(false)]
public bool AllowAsyncScrolling { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Accepts System.Boolean values. The default value is |
Remarks
Enables asynchronous rendering during large scroll jumps to improve performance during rapid offset changes. This is applicable for all types of columns on Windows platform.
Examples
The following example demonstrates how to set the AllowAsyncScrolling property in SfDataGrid.
AllowColumnSelection
Gets or sets a value indicating whether the column selection is applied to SfDataGrid when tapping or double tapping a header cell.
Declaration
[Cloneable(false)]
public bool AllowColumnSelection { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | It accepts AllowColumnSelection values and the default value is false. |
Remarks
This property allows you to apply selection to the particular column interactively.
Examples
Here is an example of how to set the AllowColumnSelection property
AllowDeleting
Gets or sets a System.Boolean value indicating whether deleting selected rows with the delete key is enabled during navigation. This is a bindable property.
Declaration
[Cloneable(false)]
public bool AllowDeleting { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
AllowDiagonalScrolling
Gets or sets a value indicating whether diagonal scrolling is allowed in the SfDataGrid.
Declaration
[Cloneable(false)]
public bool AllowDiagonalScrolling { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Accepts System.Boolean values. The default value is |
Remarks
When set to false, users can only scroll either horizontally or vertically at a time, preventing diagonal scrolling.
Examples
The following example demonstrates how to set the AllowDiagonalScrolling property in SfDataGrid.
AllowDraggingColumn
Gets or sets a value indicating whether to enable or disable the column dragging functionality in a SfDataGrid control. This is a bindable property
Declaration
[Cloneable(false)]
public bool AllowDraggingColumn { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
AllowDraggingRow
Gets or sets a value indicating whether to enable/disable the row dragging functionality in a SfDataGrid control. SfDataGrid. This is a bindable property.
Declaration
[Cloneable(false)]
public bool AllowDraggingRow { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
AllowEditing
Gets or sets a value indicating whether to enable/disable editing in runtime. SfDataGrid provides support for editing the cell values, when AllowEditing is set as true.
Declaration
public bool AllowEditing { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
AllowGroupExpandCollapse
Gets or sets a value indicating whether to allow expanding and collapsing of groups in SfDataGrid. By default, the groups will be in expanded state in SfDataGrid, when grouped. However, the user can expand or collapse a group in runtime by enabling this property.
Declaration
[Cloneable(false)]
public bool AllowGroupExpandCollapse { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
AllowKeyboardNavigation
Gets or sets a System.Boolean value indicating whether to enable keyboard navigation in SfDataGrid. This is a bindable property.
Declaration
[Cloneable(false)]
public bool AllowKeyboardNavigation { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
Applicable only when the selection mode is not set to 'None'.
AllowLoadMore
Gets or sets a value that indicates whether to enable load more in SfDataGrid. This is a bindable property.
Declaration
[Cloneable(false)]
public bool AllowLoadMore { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Examples
dataGrid.AllowLoadMore = true;
dataGrid.LoadMoreCommand = new Command(ExecuteLoadMoreCommand);
private async void ExecuteLoadMoreCommand()
{
this.dataGrid.IsBusy = true;
await Task.Delay(new TimeSpan(0, 0, 5));
viewModel.LoadMoreItems();
this.dataGrid.IsBusy = false;
}
AllowPullToRefresh
Gets or sets a value indicating whether to enable/disable the refreshing option upon pulling the grid.
Declaration
[Cloneable(false)]
public bool AllowPullToRefresh { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
AllowResizingColumns
Declaration
public bool AllowResizingColumns { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
AllowRowHoverHighlighting
Gets or sets a value indicating whether row hover highlighting is enabled in the SfDataGrid.
When enabled, the RowHoveredBackground color will be applied to rows when the mouse pointer hovers over it.
The default value is false
Declaration
public bool AllowRowHoverHighlighting { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
AllowSwiping
Gets or sets a value that indicates whether swiping is enabled for the SfDataGrid control. This is a bindable property.
Declaration
[Cloneable(false)]
public bool AllowSwiping { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | A System.Boolean value that determines whether swiping is allowed. The default value is |
Remarks
When set to true, this property enables row swiping in the SfDataGrid.
Examples
The following examples demonstrate how to set the AllowSwiping property:
AllowTriStateSorting
Gets or sets a value indicating whether user can sort the column in three states: ascending, descending, unsorted.
Declaration
public bool AllowTriStateSorting { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
This is applicable only if the DataGridSortingMode is other than None.
AlternationRowCount
Gets or sets a row count to apply the background for the rows alternatively.
Declaration
[Cloneable(false)]
public int AlternationRowCount { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
AutoExpandGroups
Gets or sets a value indicating whether the SfDataGrid should auto expand groups when grouping. By enabling, this property, when the user group any column, then all groups will be in expanded state.
Declaration
[Cloneable(false)]
public bool AutoExpandGroups { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
AutoGenerateColumnsMode
Gets or sets the AutoGenerateColumnsMode of SfDataGrid control. SfDataGrid decides columns generation based on the AutoGenerateColumnsMode property.
Declaration
public AutoGenerateColumnsMode AutoGenerateColumnsMode { get; set; }
Property Value
| Type | Description |
|---|---|
| AutoGenerateColumnsMode | The AutoGenerateColumnsMode of SfDataGrid.
The default value is |
Remarks
The user can set the mode in which the columns should be generated by using the AutoGenerateColumnsMode property. The user can also customize the automatically generated column by using the AutoGeneratingColumn event. In order to include only the columns defined manually in the Columns collection, the user must set the None.
AutoGenerateColumnsModeForCustomType
Gets or sets the value that indicates how the complex type of properties should be auto-generated.
Declaration
[Cloneable(false)]
public AutoGenerateColumnsModeForCustomType AutoGenerateColumnsModeForCustomType { get; set; }
Property Value
| Type |
|---|
| AutoGenerateColumnsModeForCustomType |
AutoGenerateRelations
Gets or sets a value that indicates whether the relations for Master-Details View are generated automatically.
Declaration
public bool AutoGenerateRelations { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if relations are auto-generated; otherwise, false. The default value is false. |
Remarks
You can cancel or customize the relation being created in the AutoGeneratingRelations event handler.
Examples
Here is an example of how to set the AutoGenerateRelations property.
CanMaintainScrollPosition
to do
Declaration
[Cloneable(false)]
public bool CanMaintainScrollPosition { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
CanUseViewFilter
Gets or sets a value indicating whether to create a view by considering ICollectionView.Filter or DataView.RowFilter.
Declaration
[Cloneable(false)]
public bool CanUseViewFilter { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if View needs to filter the rows using DataView.RowFilter expression or ICollectionView.Filter method; otherwise ,false. The default value is true |
CaptionSummaryRow
Declaration
[Cloneable(false)]
public DataGridSummaryRow CaptionSummaryRow { get; set; }
Property Value
| Type |
|---|
| DataGridSummaryRow |
CaptionSummaryTemplate
Declaration
[Cloneable(false)]
public DataTemplate CaptionSummaryTemplate { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.DataTemplate |
CellDoubleTappedCommand
Gets or sets the command to invoke when the cell is double tapped. This is a bindable property.
Declaration
[Cloneable(false)]
public ICommand CellDoubleTappedCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
CellDoubleTappedCommandParameter
Gets or sets the parameter to pass to the CellDoubleTappedCommand. property. The default value is null. This is a bindable property.
Declaration
[Cloneable(false)]
public object CellDoubleTappedCommandParameter { get; set; }
Property Value
| Type |
|---|
| System.Object |
CellEnteredCommand
Gets or sets the command to invoke when the mouse is entered to the cell. This is a bindable property.
Declaration
[Cloneable(false)]
public ICommand CellEnteredCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
CellEnteredCommandParameter
Gets or sets the parameter to pass to the CellEnteredCommand. property. The default value is null. This is a bindable property.
Declaration
[Cloneable(false)]
public object CellEnteredCommandParameter { get; set; }
Property Value
| Type |
|---|
| System.Object |
CellExitedCommand
Gets or sets the command to invoke when the mouse is exited from the cell. This is a bindable property.
Declaration
[Cloneable(false)]
public ICommand CellExitedCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
CellExitedCommandParameter
Gets or sets the parameter to pass to the CellExitedCommand. property. The default value is null. This is a bindable property.
Declaration
[Cloneable(false)]
public object CellExitedCommandParameter { get; set; }
Property Value
| Type |
|---|
| System.Object |
CellHoveredCommand
Gets or sets the command to invoke when the mouse is hovering in the cell. This is a bindable property.
Declaration
[Cloneable(false)]
public ICommand CellHoveredCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
CellHoveredCommandParameter
Gets or sets the parameter to pass to the CellHoveredCommand. property. The default value is null. This is a bindable property.
Declaration
[Cloneable(false)]
public object CellHoveredCommandParameter { get; set; }
Property Value
| Type |
|---|
| System.Object |
CellLongPressCommand
Gets or sets the command to invoke when the cell is long pressed. This is a bindable property.
Declaration
[Cloneable(false)]
public ICommand CellLongPressCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
CellLongPressCommandParameter
Gets or sets the parameter to pass to the
Declaration
[Cloneable(false)]
public object CellLongPressCommandParameter { get; set; }
Property Value
| Type |
|---|
| System.Object |
CellRenderers
Gets the GridCellRendererCollection that contains the cell renderers in SfDataGrid. The CellRenderers manages the creation of cells view objects when the cell is scrolled into view and also unloading of the views. Contains logics to place the UIElement inside cells in display and edit mode.
Declaration
public GridCellRendererCollection CellRenderers { get; }
Property Value
| Type | Description |
|---|---|
| GridCellRendererCollection | The collection containing the renderers in the SfDataGrid. |
Remarks
The CellRenderers manages the creation of cells view objects when the cell is scrolled into view and also unloading of the views. Contains logics to place the UIElement inside cells in display and edit mode. The user can implement the renderer by extending it from the renderer he needs and customize the type of cell to be loaded for each column type in editing and normal mode.
Note:When the user overrides the renderer, he needs to replace it in the CellRenderers collection.
For example, if the user implements the
CellRightTappedCommand
Gets or sets the command to invoke when the cell is tapped by the secondary click. This is a bindable property.
Declaration
[Cloneable(false)]
public ICommand CellRightTappedCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
CellRightTappedCommandParameter
Gets or sets the parameter to pass to the CellRightTappedCommand. property. The default value is null. This is a bindable property.
Declaration
[Cloneable(false)]
public object CellRightTappedCommandParameter { get; set; }
Property Value
| Type |
|---|
| System.Object |
CellTappedCommand
Gets or sets the command to invoke when the cell is tapped. This is a bindable property.
Declaration
[Cloneable(false)]
public ICommand CellTappedCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
CellTappedCommandParameter
Gets or sets the parameter to pass to the CellTappedCommand. property. The default value is null. This is a bindable property.
Declaration
[Cloneable(false)]
public object CellTappedCommandParameter { get; set; }
Property Value
| Type |
|---|
| System.Object |
ColumnDragDropTemplate
Gets or sets the view to be displayed when column drag and drop action is performed.
Declaration
[Cloneable(false)]
public DataTemplate ColumnDragDropTemplate { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.DataTemplate |
Columns
Gets or sets the Columns collection of the SfDataGrid. The Columns collection contains the columns in the SfDataGrid which are created for each property in the model class. The user can add the various column types to the SfDataGrid based on the requirement by specifying the MappingName which associates the property in the data source.
Declaration
[Cloneable(false)]
public ColumnCollection Columns { get; set; }
Property Value
| Type | Description |
|---|---|
| ColumnCollection | The columns collection of the SfDataGrid. |
Remarks
The Columns collection contains the columns in the SfDataGrid which are created for each property in the model class. SfDataGrid allows you to define the columns manually by adding the DataGridColumn objects to the Columns collection. There are different types of columns available in SfDataGrid and you can create any column based on your requirement.
Examples
List<GridColumn> myColumnsCollection = new List<GridColumn>();
myColumnsCollection.Add(new DataGridTextColumn() { MappingName = "OrderID" });
myColumnsCollection.Add(new DataGridTextColumn() { MappingName = "EmployeeID" });
myColumnsCollection.Add(new DataGridTextColumn() { MappingName = "CustomerID" });
dataGrid.Columns = myColumnsCollection;
ColumnSizer
Gets or sets the controller which controls the auto size calculation for column widths.
Declaration
[Cloneable(false)]
public DataGridColumnSizer ColumnSizer { get; set; }
Property Value
| Type |
|---|
| DataGridColumnSizer |
ColumnWidthMode
Gets or sets the value that indicates how all the columns` widths of the SfDataGrid are determined.
Declaration
public ColumnWidthMode ColumnWidthMode { get; set; }
Property Value
| Type | Description |
|---|---|
| ColumnWidthMode | The type of ColumnWidthMode that is applied to the SfDataGrid.
The default value is |
Remarks
The user can specify how columns in the SfDataGrid are sized. SfDataGrid applies width for all the DataGridColumn in the Columns collection based on the ColumnWidthMode property.
CopyOption
Gets or sets a value that indicates how the content is copied from control to the clipboard.This is bindable property.
Declaration
public DataGridCopyOption CopyOption { get; set; }
Property Value
| Type | Description |
|---|---|
| DataGridCopyOption | One of the DataGridCopyOption enumeration that specifies how the content is copied from control to the clipboard. |
Remarks
You can cancel or customize the copy operation through CopyContent and CopyCellContent event handlers in SfDataGrid.
Examples
Here is an example of how to set the CopyOption property.
CopyPasteController
Gets or sets an instance of the DataGridCopyPasteController class which controls the copy and paste operations in SfDataGrid.This is bindable property.
Declaration
public DataGridCopyPasteController CopyPasteController { get; set; }
Property Value
| Type | Description |
|---|---|
| DataGridCopyPasteController | An instance of class that derives from DataGridCopyPasteController class. The default value is null. |
Remarks
The CopyPasteController class provides various properties and virtual methods to customize its operations.
Examples
Here is an example of how to access the CopyPasteController property.
CurrentCell
Gets or sets a cell coordinates which is currently navigated.
Declaration
[Cloneable(false)]
public RowColumnIndex CurrentCell { get; set; }
Property Value
| Type |
|---|
| RowColumnIndex |
CurrentCellManager
Gets or sets the DataGridCurrentCellManager which handles the current cell operations in SfDataGrid. This is a bindable property.
Declaration
[Cloneable(false)]
public DataGridCurrentCellManager CurrentCellManager { get; set; }
Property Value
| Type |
|---|
| DataGridCurrentCellManager |
CurrentRow
Gets or sets a row which is currently navigated.
Declaration
[Cloneable(false)]
public object CurrentRow { get; set; }
Property Value
| Type |
|---|
| System.Object |
DataFetchSize
Gets or sets the data fetch size for the Incremental Source. SfDataGrid supports incremental loading, the user can customize the size of data to be fetched in incremental loading by using DataFetchSize property.
Declaration
[Cloneable(false)]
public int DataFetchSize { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The size of the data to be fetched for the incremental source. The default value is 5. |
DefaultColumnWidth
Gets or sets the default column width of the SfDataGrid. DataGridColumn renders in view based on the value of DefaultColumnWidth property in SfDataGrid.
Declaration
public double DefaultColumnWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The default column width of the SfDataGrid. The default value is 100. |
Remarks
Columns are arranged in view based on the
DefaultColumnWidth property when the ColumnWidthMode is
DefaultStyle
Gets or sets the style for the DataGrid. If it is null, the default style will be set.
Declaration
public DataGridStyle DefaultStyle { get; set; }
Property Value
| Type |
|---|
| DataGridStyle |
DetailsViewDefaultStyle
Gets or sets the style applied to all the DetailsViewDataGrid.
Declaration
public DataGridStyle DetailsViewDefaultStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| DataGridStyle | The style that is applied to all the DetailsViewDataGrid. The default value is null. |
Remarks
To define a DataGridStyle for a DetailsViewDataGrid, specify a TargetType of DetailsViewDataGrid.
Examples
Here is an example of how to set the
<syncfusion:SfDataGrid>
<syncfusion:SfDataGrid.DetailsViewDataGridStyle>
<syncfusion:DataGridStyle BackgroundColor="LightGray" />
</syncfusion:SfDataGrid.DetailsViewDataGridStyle>
</syncfusion:SfDataGrid>
DetailsViewDefinition
Gets or sets the collection of ViewDefinition that enables you to represent the data in a hierarchical format.
Declaration
[Cloneable(false)]
public DetailsViewDefinition DetailsViewDefinition { get; set; }
Property Value
| Type | Description |
|---|---|
| DetailsViewDefinition | The collection of ViewDefinition. The default value is null. |
Remarks
The DetailsViewDefinition allows you to display child grids within the parent SfDataGrid. You can define multiple levels of hierarchy using DataGridViewDefinition.
Examples
Here is an example of how to define the DetailsViewDefinition in both XAML and C#.
<syncfusion:SfDataGrid.DetailsViewDefinition>
<syncfusion:GridViewDefinition RelationalColumn="Sales">
<syncfusion:GridViewDefinition.DataGrid>
<syncfusion:SfDataGrid AutoGenerateRelations="True">
</syncfusion:SfDataGrid>
</syncfusion:GridViewDefinition.DataGrid>
</syncfusion:GridViewDefinition>
</syncfusion:SfDataGrid.DetailsViewDefinition>
DetailsViewPadding
Gets or sets the padding of the DetailsViewDataGrid.
Declaration
[Cloneable(false)]
public Thickness DetailsViewPadding { get; set; }
Property Value
| Type | Description |
|---|---|
| Microsoft.Maui.Thickness | The padding for the DetailsViewDataGrid. |
Remarks
The DetailsViewPadding needs to be defined on its parent DataGrid when the child grid requires padding.
Examples
Here is an example of how to set the DetailsViewPadding property.
EditTapAction
Gets or sets the edit TapAction to enter edit mode in SfDataGrid. SfDataGrid provides support for editing the cell values, when AllowEditing is set as true.
Declaration
public DataGridTapAction EditTapAction { get; set; }
Property Value
| Type |
|---|
| DataGridTapAction |
EmptyView
Gets or sets a content or view that will be displayed when there are no records in SfDataGrid
Declaration
[Cloneable(false)]
public object EmptyView { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object | The Empty view’s type is object, so it accepts both string and view type values |
Remarks
It helps to identify the items source is empty instead of showing a blank view.
Examples
Here is an example of how to set the EmptyView property.
EmptyViewTemplate
Gets or sets a data template that will be displayed for empty view in SfDataGrid
Declaration
[Cloneable(false)]
public DataTemplate EmptyViewTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.DataTemplate | It accepts the data template and template selector value. |
Remarks
It helps to identify the items source is empty instead of showing a blank view.
Examples
Here is an example of how to set the EmptyViewTemplate property.
<local:SfDataGrid.EmptyViewTemplate>
<DataTemplate>
<Label Text = "No records"
VerticalOptions="CenterAndExpand"
FontSize="18" FontFamily="Roboto-Regular"/>
</DataTemplate>
</local:SfDataGrid.EmptyViewTemplate>
EnableDataVirtualization
Gets or sets a value indicating whether to create RecordEntry for all the objects in SourceCollection while loading itself. By default RecordEntry created for all the objects of SourceCollection.
Declaration
[Cloneable(false)]
public bool EnableDataVirtualization { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | True to create RecordEntry only when try to access this index. |
Remarks
If the SourceCollection is null then GetItemAt(Int32) used to populates the Records.
Examples
dataGrid.EnableDataVirtualization = true;
ErrorIconTemplate
Gets or sets the template used to display the ErrorIcon.
Declaration
public DataTemplate ErrorIconTemplate { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.DataTemplate |
ErrorTipTemplate
Gets or sets the template used to display the Errortip content.
Declaration
public DataTemplate ErrorTipTemplate { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.DataTemplate |
ExpanderColumnWidth
Gets or sets the expander column width.
Declaration
[Cloneable(false)]
public double ExpanderColumnWidth { get; set; }
Property Value
| Type |
|---|
| System.Double |
Remarks
Details view can be enabled by setting DetailsViewDefinition.
FilterRowCellRenderers
Gets the reference to the GridCellRendererCollection instance which holds the collection of all predefined cell renderers DataGridFilterRowRendererBase<T1, T2>.
Declaration
public GridCellRendererCollection FilterRowCellRenderers { get; }
Property Value
| Type |
|---|
| GridCellRendererCollection |
FilterRowPosition
Gets or sets the position of the filter row in the DataGrid.
Declaration
[Cloneable(false)]
public DataGridFilterRowPosition FilterRowPosition { get; set; }
Property Value
| Type |
|---|
| DataGridFilterRowPosition |
FrozenColumnCount
The number of non-scrolling columns at the left side of SfDataGrid
Declaration
[Cloneable(false)]
public int FrozenColumnCount { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The default value is 0. |
Remarks
FrozenColumnCount value should be less than the number of columns displayed in the view. For example, if you have 5 columns in the view, you can set the FrozenColumnCount value to a maximum of 4.
See Also
FrozenRowCount
The number of non-scrolling rows at the top of SfDataGrid
Declaration
[Cloneable(false)]
public int FrozenRowCount { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The default value is 0. |
Remarks
FrozenRowCount value should be less than the number of rows displayed in the view. For example, if you have 10 rows in the view, you can set the FrozenRowCount value to a maximum of 9.
See Also
GridLinesVisibility
Gets or sets the visibility of the grid lines for the data rows.
Declaration
public GridLinesVisibility GridLinesVisibility { get; set; }
Property Value
| Type | Description |
|---|---|
| GridLinesVisibility | A GridLinesVisibility that represents whether the horizontal, vertial or both grid lines should be drawn. The default value is Horizontal. |
Remarks
To customize the visibility of the grid lines of the header, you can use HeaderGridLinesVisibility.
GroupCaptionContextMenu
Gets or sets the collection of menu items to be displayed in the group caption context menu.
Declaration
public MenuItemCollection GroupCaptionContextMenu { get; set; }
Property Value
| Type | Description |
|---|---|
| MenuItemCollection | A collection of menu items for the group caption context menu. |
Remarks
The group caption context menu appears when right-clicking (on desktop platforms) or long-pressing (on mobile platforms) on a group caption cell.
Examples
Here is an example of how to define the GroupCaptionContextMenu property.
[XAML]
<syncfusion:SfDataGrid x:Name=""dataGrid""
ItemsSource=""{Binding YourGroupedData}""
AutoGenerateColumns=""True""
ShowGroupDropArea=""True""
AllowGrouping=""True"">
<syncfusion:SfDataGrid.GroupCaptionContextMenu>
<syncfusion:MenuItemCollection>
<syncfusion:MenuItem Text=""Expand"" Command=""{Binding ExpandGroupCommand}"" />
<syncfusion:MenuItem Text=""Collapse"" Command=""{Binding CollapseGroupCommand}"" />
</syncfusion:MenuItemCollection>
</syncfusion:SfDataGrid.GroupCaptionContextMenu>
</syncfusion:SfDataGrid>
[C#]
dataGrid.GroupCaptionContextMenu = new MenuItemCollection
{
new MenuItem { Text = ""Expand"", Command = ViewModel.ExpandGroupCommand },
new MenuItem { Text = ""Collapse"", Command = ViewModel.CollapseGroupCommand }
};
GroupCaptionTextFormat
Gets or sets the group caption text format of the caption summary rows in SfDataGrid. Every group as a caption summary row, which is used to display the summary information in the caption of the group.SfDataGrid allows to customize the group caption text format by using this property.
Declaration
[Cloneable(false)]
public string GroupCaptionTextFormat { get; set; }
Property Value
| Type |
|---|
| System.String |
GroupColumnDescriptions
Gets or sets the GroupColumnDescriptions of the SfDataGrid. The user can get the columns that represent grouping from the GroupColumnDescriptions collection. SfDataGrid allows to perform grouping from the code by defining the GroupColumnDescription object and adding it in the GroupColumnDescriptions collection.
Declaration
[Cloneable(false)]
public GroupColumnDescriptionCollection GroupColumnDescriptions { get; set; }
Property Value
| Type |
|---|
| GroupColumnDescriptionCollection |
GroupExpandCollapseTemplate
Gets or Sets the GroupExpandCollapseTemplate
Declaration
[Cloneable(false)]
public DataTemplate GroupExpandCollapseTemplate { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.DataTemplate |
GroupingMode
Gets or sets a value that indicates whether to allow multiple columns in SfDataGrid. By default, the last column gets grouped if multiple GroupColumnDescription are added. other GroupColumnDescriptions will be cleared.
Declaration
[Cloneable(false)]
public GroupingMode GroupingMode { get; set; }
Property Value
| Type |
|---|
| GroupingMode |
GroupSummaryContextMenu
Gets or sets the collection of menu items to be displayed in the group summary context menu.
Declaration
public MenuItemCollection GroupSummaryContextMenu { get; set; }
Property Value
| Type | Description |
|---|---|
| MenuItemCollection | A collection of menu items for the group summary context menu. |
Remarks
The group summary context menu appears when right-clicking (on desktop platforms) or long-pressing (on mobile platforms) on a group summary row.
Examples
Here is an example of how to define the GroupSummaryContextMenu property.
[XAML]
<syncfusion:SfDataGrid x:Name=""dataGrid""
ItemsSource=""{Binding YourGroupedData}""
AutoGenerateColumns=""True""
ShowGroupDropArea=""True""
AllowGrouping=""True"">
<syncfusion:SfDataGrid.GroupSummaryContextMenu>
<syncfusion:MenuItemCollection>
<syncfusion:MenuItem Text=""Clear Summary"" Command=""{Binding ClearSummaryCommand}"" />
</syncfusion:MenuItemCollection>
</syncfusion:SfDataGrid.GroupSummaryContextMenu>
</syncfusion:SfDataGrid>
[C#]
dataGrid.GroupSummaryContextMenu = new MenuItemCollection
{
new MenuItem { Text = ""Clear Summary"", Command = ViewModel.ClearSummaryCommand }
};
GroupSummaryRows
Declaration
[Cloneable(false)]
public ObservableCollection<DataGridSummaryRow> GroupSummaryRows { get; set; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<DataGridSummaryRow> |
GroupSummaryTemplate
Declaration
[Cloneable(false)]
public DataTemplate GroupSummaryTemplate { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.DataTemplate |
HeaderContextMenu
Gets or sets the collection of menu items to be displayed in the header context menu.
Declaration
public MenuItemCollection HeaderContextMenu { get; set; }
Property Value
| Type | Description |
|---|---|
| MenuItemCollection | A collection of menu items for the header context menu. |
Remarks
This property allows customization of the context menu that appears when interacting with header cells.
Examples
Here is an example of how to define the HeaderContextMenu property.
[XAML]
<syncfusion:SfDataGrid x:Name=""dataGrid""
ItemsSource=""{Binding YourData}""
AutoGenerateColumns=""True"">
<syncfusion:SfDataGrid.HeaderContextMenu>
<syncfusion:MenuItemCollection>
<syncfusion:MenuItem Text=""Sort Ascending"" Command=""{Binding SortAscendingCommand}"" />
<syncfusion:MenuItem Text=""Sort Descending"" Command=""{Binding SortDescendingCommand}"" />
<syncfusion:MenuItem Text=""Group by Column"" Command=""{Binding GroupByColumnCommand}"" />
</syncfusion:MenuItemCollection>
</syncfusion:SfDataGrid.HeaderContextMenu>
</syncfusion:SfDataGrid>
[C#]
dataGrid.HeaderContextMenu = new MenuItemCollection
{
new MenuItem { Text = ""Sort Ascending"", Command = ViewModel.SortAscendingCommand },
new MenuItem { Text = ""Sort Descending"", Command = ViewModel.SortDescendingCommand },
new MenuItem { Text = ""Group by Column"", Command = ViewModel.GroupByColumnCommand }
};
HeaderGridLinesVisibility
Gets or sets the visibility of the grid lines for the column headers.
Declaration
public GridLinesVisibility HeaderGridLinesVisibility { get; set; }
Property Value
| Type | Description |
|---|---|
| GridLinesVisibility | A GridLinesVisibility that represents whether the horizontal, vertial or both grid lines should be drawn. The default value is Horizontal. |
Remarks
To customize the visibility of the grid lines of the data rows, you can use GridLinesVisibility.
HeaderRowHeight
Gets or sets the height of a header row.
Declaration
public double HeaderRowHeight { get; set; }
Property Value
| Type |
|---|
| System.Double |
HideEmptyDataGridViewDefinition
Gets or sets a value that indicates whether the expander should be hidden when relational column property has an empty collection or null.
Declaration
public bool HideEmptyDataGridViewDefinition { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if the expander is hidden from the view; otherwise, false. The default value is false. |
HorizontalScrollBarVisibility
Gets or sets a value that controls when the horizontal scrollbar is visible.
Declaration
[Cloneable(false)]
public ScrollBarVisibility HorizontalScrollBarVisibility { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.ScrollBarVisibility |
Remarks
This API is only available for the WinUI platform.
IndentColumnWidth
Gets or sets the width of the indent column.
Declaration
[Cloneable(false)]
public double IndentColumnWidth { get; set; }
Property Value
| Type |
|---|
| System.Double |
IsBusy
Declaration
[Cloneable(false)]
public bool IsBusy { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ItemsSource
Gets or sets an external data source for SfDataGrid, to display the data in the grid. It supports the data sources such as System.Collections.Generic.List<>, System.Collections.ObjectModel.ObservableCollection<>, and so on. ItemsSource property helps to bind the SfDataGrid with the collection of objects.
Declaration
[Cloneable(false)]
public object ItemsSource { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object | The items source of the SfDataGrid. |
Remarks
To bind the SfDataGrid to data, set the ItemsSource property to an System.Collections.IEnumerable implementation. Each row in the datagrid is bound to an object in the data source, and each column in the data grid is bound to a property of the data object. In order to update the SfDataGrid user interface automatically when the items are added to or removed from the source data, the SfDataGrid must be bound to a collection that implements the System.Collections.Specialized.INotifyCollectionChanged interface, such as an System.Collections.ObjectModel.ObservableCollection<>. To automatically reflect property changes, the objects in the source collection must implement the System.ComponentModel.INotifyPropertyChanged interface.
LeftSwipeTemplate
Gets or sets the Microsoft.Maui.Controls.DataTemplate that is displayed when swiping a row from left to right. This is a bindable property.
Declaration
[Cloneable(false)]
public DataTemplate LeftSwipeTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.DataTemplate | A Microsoft.Maui.Controls.DataTemplate that defines the content displayed during a left-to-right swipe. The default value is |
Remarks
The LeftSwipeTemplate property allows customization of the content shown when a row is swiped in the left-to-right direction.
Examples
The following examples demonstrate how to set the LeftSwipeTemplate property:
<local:SfDataGrid AllowSwiping="True">
<local:SfDataGrid.LeftSwipeTemplate>
<DataTemplate>
<Label BackgroundColor = "Yellow" Text="Left"/>
</DataTemplate>
</local:SfDataGrid.LeftSwipeTemplate>
</local:SfDataGrid>
LiveDataUpdateMode
to do
Declaration
[Cloneable(false)]
public LiveDataUpdateMode LiveDataUpdateMode { get; set; }
Property Value
| Type |
|---|
| LiveDataUpdateMode |
LoadMoreCommand
Declaration
[Cloneable(false)]
public ICommand LoadMoreCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
LoadMorePosition
Declaration
[Cloneable(false)]
public DataGridLoadMorePosition LoadMorePosition { get; set; }
Property Value
| Type |
|---|
| DataGridLoadMorePosition |
Examples
dataGrid.LoadMorePosition = DataGridLoadMorePosition.Top;
LoadMoreText
Declaration
[Cloneable(false)]
public string LoadMoreText { get; set; }
Property Value
| Type |
|---|
| System.String |
Examples
dataGrid.LoadMoreText = "Load More Items";
LoadMoreView
Gets or sets the load more view that will be displayed when the vertical scrollbar is scrolled to the top or bottom position of SfDataGrid. This is a bindable property.
Declaration
[Cloneable(false)]
public DataGridLoadMoreView LoadMoreView { get; set; }
Property Value
| Type |
|---|
| DataGridLoadMoreView |
Remarks
The load more view will be displayed only when the AllowLoadMore property is enabled. The position of load more view can be customized by LoadMorePosition property.
Examples
dataGrid.LoadMoreView = new CustomLoadMoreView();
public class CustomLoadMoreView : DataGridLoadMoreView
{
}
LostFocusBehavior
Gets or sets a value that specifies the behavior of the DataGrid when it loses focus. This property is applicable only for DataGridTextColumn and DataGridNumericColumn.
Declaration
public DataGridLostFocusBehavior LostFocusBehavior { get; set; }
Property Value
| Type | Description |
|---|---|
| DataGridLostFocusBehavior | The default value is |
Remarks
This property is applicable only for DataGridTextColumn and DataGridNumericColumn.
MaxSwipeOffset
Gets or sets the maximum swipe threshold. This is a bindable property.
Declaration
[Cloneable(false)]
public double MaxSwipeOffset { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | A System.Double that defines the maximum swipe offset. The default value is |
Remarks
The MaxSwipeOffset property specifies the maximum distance a row can be swiped before the swipe action is considered complete.
Examples
The following examples demonstrate how to set the MaxSwipeOffset property:
NavigationMode
Gets or sets the value that indicates the navigation mode in the DataGrid.
Declaration
[Cloneable(false)]
public DataGridNavigationMode NavigationMode { get; set; }
Property Value
| Type | Description |
|---|---|
| DataGridNavigationMode | A DataGridNavigationMode that represents whether the selection should be navihation based on cell or row. The default value is Cell. |
NewItemPlaceholderPosition
Gets or sets the position for the new item placeholder in the DataGrid.
Declaration
public NewItemPlaceholderPosition NewItemPlaceholderPosition { get; set; }
Property Value
| Type |
|---|
| NewItemPlaceholderPosition |
NotifyEventsToParentDataGrid
Gets or sets a value that indicates whether to notify details view DataGrid or child data DataGrid events to the parent DataGrid. This allows event handling to be centralized in the parent DataGrid, eliminating the need to handle events at each hierarchical level.
Declaration
public bool NotifyEventsToParentDataGrid { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if the child DataGrid notifies events to the parent DataGrid; otherwise, false. The default value is false. |
Examples
Here is an example of how to set the NotifyEventsToParentDataGrid property.
<syncfusion:SfDataGrid.DetailsViewDefinition>
<syncfusion:GridViewDefinition RelationalColumn="OrderDetails">
<syncfusion:GridViewDefinition.DataGrid>
<syncfusion:SfDataGrid x:Name="FirstDetailsViewGrid"
NotifyEventsToParentDataGrid="True">
</syncfusion:SfDataGrid>
</syncfusion:GridViewDefinition.DataGrid>
</syncfusion:GridViewDefinition>
</syncfusion:SfDataGrid.DetailsViewDefinition>
PasteOption
Gets or sets a value that indicates how the clipboard value is pasted.This is bindable property.
Declaration
public DataGridPasteOption PasteOption { get; set; }
Property Value
| Type | Description |
|---|---|
| DataGridPasteOption | One of the DataGridPasteOption enumeration that specifies how the clipboard value is pasted. |
Remarks
You can customize or cancel the paste operations through PasteContent and PasteCellContent event handlers in SfDataGrid.
Examples
Here is an example of how to set the PasteOption property.
PullToRefreshCommand
Gets or sets the command to be executed when performing the pulling operation to refresh the grid. This command will be fired upon performing the pulling operation for doing the refreshing operation.
Declaration
[Cloneable(false)]
public ICommand PullToRefreshCommand { get; set; }
Property Value
| Type |
|---|
| System.Windows.Input.ICommand |
RecordContextMenu
Gets or sets the collection of menu items to be displayed in the record context menu.
Declaration
public MenuItemCollection RecordContextMenu { get; set; }
Property Value
| Type | Description |
|---|---|
| MenuItemCollection | A collection of menu items for the record context menu. |
Remarks
The record context menu appears when right-clicking (on desktop platforms) or long-pressing (on mobile platforms) on a data row.
Examples
Here is an example of how to define the RecordContextMenu property.
[XAML]
<syncfusion:SfDataGrid x:Name=""dataGrid""
ItemsSource=""{Binding YourData}""
AutoGenerateColumns=""True"">
<syncfusion:SfDataGrid.RecordContextMenu>
<syncfusion:MenuItemCollection>
<syncfusion:MenuItem Text=""Edit"" Command=""{Binding EditRecordCommand}"" />
<syncfusion:MenuItem Text=""Delete"" Command=""{Binding DeleteRecordCommand}"" />
</syncfusion:MenuItemCollection>
</syncfusion:SfDataGrid.RecordContextMenu>
</syncfusion:SfDataGrid>
[C#]
dataGrid.RecordContextMenu = new MenuItemCollection
{
new MenuItem { Text = ""Edit"", Command = ViewModel.EditRecordCommand },
new MenuItem { Text = ""Delete"", Command = ViewModel.DeleteRecordCommand }
};
ReuseRowsOnItemsSourceChange
Gets or sets a value indicating whether to regenerate the rows or reuse the existing rows when the ItemsSource is changed at runtime.
Declaration
[Cloneable(false)]
public bool ReuseRowsOnItemsSourceChange { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
RightSwipeTemplate
Gets or sets the Microsoft.Maui.Controls.DataTemplate that is displayed when swiping a row from right to left. This is a bindable property.
Declaration
[Cloneable(false)]
public DataTemplate RightSwipeTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.DataTemplate | A Microsoft.Maui.Controls.DataTemplate that defines the content displayed during a right-to-left swipe. The default value is |
Remarks
The RightSwipeTemplate property allows customization of the content shown when a row is swiped in the right-to-left direction.
Examples
The following examples demonstrate how to set the RightSwipeTemplate property:
<local:SfDataGrid AllowSwiping="True">
<local:SfDataGrid.RightSwipeTemplate>
<DataTemplate>
<Label BackgroundColor = "Red" Text="Right"/>
</DataTemplate>
</local:SfDataGrid.RightSwipeTemplate>
</local:SfDataGrid>
RowDragDropTemplate
Gets or sets the view to be displayed when row drag and drop action is performed.
Declaration
[Cloneable(false)]
public DataTemplate RowDragDropTemplate { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.DataTemplate |
RowHeaderTemplate
Gets or sets the template that is used to display the contents of a row header. This is a bindable property
Declaration
[Cloneable(false)]
public DataTemplate RowHeaderTemplate { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.DataTemplate |
RowHeaderWidth
Gets or sets the width of the row header column which will be frozen at the left end of the view. This is a bindable property.
Declaration
[Cloneable(false)]
public double RowHeaderWidth { get; set; }
Property Value
| Type |
|---|
| System.Double |
RowHeight
Gets or sets the default height of the all the rows.
Declaration
public double RowHeight { get; set; }
Property Value
| Type |
|---|
| System.Double |
Remarks
You can use the HeaderRowHeight property to set the height for header row. In order to fit the rows based on its cells content, use the QueryRowHeight event.
ScrollingMode
Gets or sets the enum value of ScrollingMode
Declaration
public DataGridScrollingMode ScrollingMode { get; set; }
Property Value
| Type |
|---|
| DataGridScrollingMode |
SearchController
Gets or sets the DataGridSearchController which handles the searching operations in
Declaration
[Cloneable(false)]
public DataGridSearchController SearchController { get; set; }
Property Value
| Type |
|---|
| DataGridSearchController |
SelectedDetailsViewDataGrid
Gets or sets the DetailsViewDataGrid that is currently selected.
Declaration
[Cloneable(false)]
public SfDataGrid SelectedDetailsViewDataGrid { get; set; }
Property Value
| Type | Description |
|---|---|
| SfDataGrid | Returns the selected details view DataGrid. |
Remarks
You can access the properties and their values of the selected details view DataGrid through this property.
Examples
Here is an example of how to access the SelectedDetailsViewDataGrid property.
SelectedIndex
Gets or sets an index of the currently selected row.
Declaration
[Cloneable(false)]
public int SelectedIndex { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
SelectedRow
Gets or sets a row which is currently selected.
Declaration
[Cloneable(false)]
public object SelectedRow { get; set; }
Property Value
| Type |
|---|
| System.Object |
SelectedRows
Gets or sets the collection of rows which are all selected.
Declaration
[Cloneable(false)]
public ObservableCollection<object> SelectedRows { get; set; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<System.Object> |
SelectionController
Gets or sets the DataGridSelectionController which handles the selection operations in SfDataGrid. This is a bindable property.
Declaration
[Cloneable(false)]
public DataGridSelectionController SelectionController { get; set; }
Property Value
| Type |
|---|
| DataGridSelectionController |
SelectionMode
Gets or sets a value that indicates how the selection should be applied.
Declaration
[Cloneable(false)]
public DataGridSelectionMode SelectionMode { get; set; }
Property Value
| Type | Description |
|---|---|
| DataGridSelectionMode | A DataGridSelectionMode that represents whether the single, singledeselect and multiple should be applied for rows. The default value is None. |
SelectionUnit
Gets or sets a value that indicates whether the rows, the cells or both the rows and cells are selectable in SfDataGrid.
Declaration
[Cloneable(false)]
public DataGridSelectionUnit SelectionUnit { get; set; }
Property Value
| Type |
|---|
| DataGridSelectionUnit |
Remarks
This property allows you to customize the selection behavior in the SfDataGrid. You can specify whether only rows, only cells, or both rows and cells can be selected.
Examples
Here is an example of how to set the DataGridSelectionUnit property
SerializationController
Gets or sets an instance of DataGridSerializationController that controls the serialization operations in SfDataGrid.
Declaration
[Cloneable(false)]
public DataGridSerializationController SerializationController { get; set; }
Property Value
| Type |
|---|
| DataGridSerializationController |
ShowColumnWhenGrouped
Gets or sets a value indicating whether the column is displayed on DataGrid after it is grouped.
Declaration
[Cloneable(false)]
public bool ShowColumnWhenGrouped { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ShowDetailsViewIndentCell
Gets or sets a value that indicates the visibility of DetailsViewIndentCell in SfDataGrid.
Declaration
public bool ShowDetailsViewIndentCell { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if the DetailsViewIndentCell is visible; otherwise, false. The default value is true. |
ShowRowHeader
Gets or sets a value indicating whether to include the row header or not. By default, nothing will be displayed in the row header. However, when RowHeaderTemplate property is set, the datagrid loads the given template as the content of the row header cells. This is a bindable property.
Declaration
[Cloneable(false)]
public bool ShowRowHeader { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ShowSortNumbers
Gets or sets a value indicating whether the sequence number should be displayed on the header cell of sorted column during multi-column sorting.
Declaration
public bool ShowSortNumbers { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ShowToolTip
Gets or sets a value that indicates whether to show tooltip when hovering over cells in SfDataGrid.
Declaration
public bool ShowToolTip { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
SortColumnDescriptions
Gets or sets the collection of the sort descriptions of column which are sorted.
Declaration
public SortColumnDescriptionCollection SortColumnDescriptions { get; set; }
Property Value
| Type |
|---|
| SortColumnDescriptionCollection |
SortComparers
Gets or sets the collection of comparers to sort the columns in custom logic.
Declaration
public SortComparers SortComparers { get; }
Property Value
| Type |
|---|
| SortComparers |
SortIconTemplate
Gets or Sets the SortIconTemplate
Declaration
public DataTemplate SortIconTemplate { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.DataTemplate |
SortingGestureType
Gets or sets a value that indicates how the sorting should be initiated.
Declaration
public DataGridSortingGestureType SortingGestureType { get; set; }
Property Value
| Type | Description |
|---|---|
| DataGridSortingGestureType | A DataGridSortingGestureType that represents whether the sorting should be applied on tap or double tap. The default value is Tap. |
SortingMode
Gets or sets the value that indicates how the sorting should be applied.
Declaration
public DataGridSortingMode SortingMode { get; set; }
Property Value
| Type | Description |
|---|---|
| DataGridSortingMode | A DataGridSortingMode that represents whether the single or multiple columns should be sorted. The default value is None. |
SourceType
Gets or sets the SourceType of the ItemsSource.
Declaration
[Cloneable(false)]
public Type SourceType { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Type | The type of the data source of SfDataGrid. |
StackedHeaderRows
Gets or sets the collection of DataGridStackedHeaderRow to add additional headers to group the column headers.
Declaration
public ObservableCollection<DataGridStackedHeaderRow> StackedHeaderRows { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.ObjectModel.ObservableCollection<DataGridStackedHeaderRow> | The collection of DataGridStackedHeaderRow. The default value is null. |
Examples
<syncfusion:SfDataGrid x:Name="dataGrid" AutoGenerateColumnsMode="None"
ItemsSource="{Binding Employees}">
<syncfusion:SfDataGrid.StackedHeaderRows>
<syncfusion:DataGridStackedHeaderRow>
<syncfusion:DataGridStackedHeaderRow.Columns>
<syncfusion:DataGridStackedColumn
ColumnMappingNames = "EmployeeID,Name"
Text="Employee Details"
/>
</syncfusion:DataGridStackedHeaderRow.Columns>
</syncfusion:DataGridStackedHeaderRow>
</syncfusion:SfDataGrid.StackedHeaderRows>
<syncfusion:SfDataGrid.Columns>
<syncfusion:DataGridTextColumn MappingName = "EmployeeID" />
< syncfusion:DataGridTextColumn MappingName = "Name" />
< syncfusion:DataGridTextColumn MappingName = "Title" />
</ syncfusion:SfDataGrid.Columns>
</syncfusion:SfDataGrid>
SfDataGrid dataGrid = new SfDataGrid();
dataGrid.AutoGenerateColumnsMode = AutoGenerateColumnsMode.None;
dataGrid.Columns.Add(new DataGridTextColumn() { MappingName = "EmployeeID", HeaderText = "Employee ID" });
dataGrid.Columns.Add(new DataGridTextColumn() { MappingName = "Name", HeaderText = "Name" });
dataGrid.Columns.Add(new DataGridTextColumn() { MappingName = "Title", HeaderText = "Title" });
var stackedHeaderRow = new DataGridStackedHeaderRow();
stackedHeaderRow.Columns.Add(new DataGridStackedColumn()
{
ColumnMappingNames = "EmployeeID,Name",
Text = "Employee Details",
});
dataGrid.StackedHeaderRows.Add(stackedHeaderRow);
SummaryCalculationMode
to do
Declaration
[Cloneable(false)]
public CalculationMode SummaryCalculationMode { get; set; }
Property Value
| Type |
|---|
| CalculationMode |
SwipeOffsetMode
Gets or sets the DataGridSwipeOffsetMode that determines whether to use the MaxSwipeOffset or the swipe view's content width to calculate the swipe threshold. This is a bindable property.
Declaration
[Cloneable(false)]
public DataGridSwipeOffsetMode SwipeOffsetMode { get; set; }
Property Value
| Type | Description |
|---|---|
| DataGridSwipeOffsetMode | A DataGridSwipeOffsetMode that defines the swipe offset mode. The default value is |
Remarks
The SwipeOffsetMode property specifies the method used to calculate the swipe threshold, either based on a custom value or automatically determined by the content width of the swipe view.
Examples
The following examples demonstrate how to set the SwipeOffsetMode property:
TableSummaryContextMenu
Gets or sets the collection of menu items to be displayed in the table summary context menu.
Declaration
public MenuItemCollection TableSummaryContextMenu { get; set; }
Property Value
| Type | Description |
|---|---|
| MenuItemCollection | A collection of menu items for the table summary context menu. |
Remarks
The table summary context menu appears when right-clicking (on desktop platforms) or long-pressing (on mobile platforms) on a table summary row.
Examples
Here is an example of how to define the TableSummaryContextMenu property.
[XAML]
<syncfusion:SfDataGrid x:Name=""dataGrid""
ItemsSource=""{Binding YourData}""
AutoGenerateColumns=""True""
ShowTableSummary=""True"">
<syncfusion:SfDataGrid.TableSummaryContextMenu>
<syncfusion:MenuItemCollection>
<syncfusion:MenuItem Text=""Count"" Command=""{Binding CountCommand}"" />
<syncfusion:MenuItem Text=""Max"" Command=""{Binding MaxCommand}"" />
<syncfusion:MenuItem Text=""Min"" Command=""{Binding MinCommand}"" />
<syncfusion:MenuItem Text=""Average"" Command=""{Binding AverageCommand}"" />
<syncfusion:MenuItem Text=""Sum"" Command=""{Binding SumCommand}"" />
</syncfusion:MenuItemCollection>
</syncfusion:SfDataGrid.TableSummaryContextMenu>
</syncfusion:SfDataGrid>
[C#]
dataGrid.TableSummaryContextMenu = new MenuItemCollection
{
new MenuItem { Text = ""Count"", Command = ViewModel.CountCommand },
new MenuItem { Text = ""Max"", Command = ViewModel.MaxCommand },
new MenuItem { Text = ""Min"", Command = ViewModel.MinCommand },
new MenuItem { Text = ""Average"", Command = ViewModel.AverageCommand },
new MenuItem { Text = ""Sum"", Command = ViewModel.SumCommand }
};
TableSummaryRows
Gets or sets the collection of TableSummaryRows of the SfDataGrid. The table summary value is calculated based on all the records in SfDataGrid. SfDataGrid allows you to add multiple table summary rows either at top or bottom or at both positions
Declaration
public ObservableCollection<DataGridTableSummaryRow> TableSummaryRows { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.ObjectModel.ObservableCollection<DataGridTableSummaryRow> | The collection of DataGridTableSummaryRow of SfDataGrid. |
TableSummaryTemplate
Gets or sets the template that is used to display the contents of a table summary. When this property is set, SfDataGrid loads the template as the content of the entire table summary row.
Declaration
[Cloneable(false)]
public DataTemplate TableSummaryTemplate { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.DataTemplate |
ToolTipTemplate
Gets or sets the template used to display the tooltip content.
Declaration
public DataTemplate ToolTipTemplate { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.DataTemplate |
TransitionType
Gets or sets a PullToRefreshTransitionType, decides the transition of progress indicator.
Declaration
[Cloneable(false)]
public PullToRefreshTransitionType TransitionType { get; set; }
Property Value
| Type |
|---|
| PullToRefreshTransitionType |
UnboundRowCellRenderers
Declaration
[Cloneable(false)]
public GridCellRendererCollection UnboundRowCellRenderers { get; }
Property Value
| Type |
|---|
| GridCellRendererCollection |
UnboundRows
Gets or sets the collection of unbound rows that will be displayed to the SfDataGrid.
Declaration
public DataGridUnboundRows UnboundRows { get; set; }
Property Value
| Type |
|---|
| DataGridUnboundRows |
ValidationMode
Gets or sets the validation mode of the SfDataGrid.
Declaration
public DataGridValidationMode ValidationMode { get; set; }
Property Value
| Type | Description |
|---|---|
| DataGridValidationMode | The default validation mode of the SfDataGrid. The default value is None. |
VerticalOverScrollMode
Gets or sets a value indicating what effect should be applied when SfDataGrid is vertically over-scrolled.
Declaration
[Cloneable(false)]
public DataGridVerticalOverScrollMode VerticalOverScrollMode { get; set; }
Property Value
| Type | Description |
|---|---|
| DataGridVerticalOverScrollMode | The VerticalOverScrollMode of SfDataGrid. The default value is |
Remarks
The VerticalOverScrollMode The property has no effect on desktop platforms, as they do not support bounce effects.
Examples
Here is an example of how to set the VerticalOverScrollMode property.
VerticalScrollBarVisibility
Gets or sets a value that controls when the vertical scrollbar is visible.
Declaration
[Cloneable(false)]
public ScrollBarVisibility VerticalScrollBarVisibility { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.ScrollBarVisibility |
Remarks
This API is only available for the WinUI platform.
View
ToDo
Declaration
public ICollectionViewAdv View { get; }
Property Value
| Type |
|---|
| ICollectionViewAdv |
Methods
ArrangeContent(Rect)
ToDo
Declaration
protected override Size ArrangeContent(Rect bounds)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.Maui.Graphics.Rect | bounds |
Returns
| Type |
|---|
| Microsoft.Maui.Graphics.Size |
Overrides
BeginEdit(Int32, Int32)
Begins editing of the grid cell in the specified row and column index.
Declaration
public void BeginEdit(int rowIndex, int columnIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowIndex | The row index in which editing should be done. |
| System.Int32 | columnIndex | The column index in which editing should be done. |
Remarks
The user can edit the required cell programmatically by using this method, specifying the row and column index of the cell to be edited.
CancelEdit()
Cancels the editing of the grid cell which is currently being edited.
Declaration
public void CancelEdit()
Remarks
The user can cancel the editing in the current cell programmatically by using this method. Edited values will not be committed to the GridCell.
CanHandleGesture(Object)
Declaration
public bool CanHandleGesture(object pullToRefresh)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | pullToRefresh |
Returns
| Type |
|---|
| System.Boolean |
ClearSelection()
Clears the selection in a SfDataGrid control.
Declaration
public void ClearSelection()
CollapseAllDetailsView()
Collapses all the DetailsViewDataGrids in SfDataGrid.
Declaration
public void CollapseAllDetailsView()
CollapseAllGroups()
Collapses all the groups in SfDataGrid.
Declaration
public void CollapseAllGroups()
CollapseDetailsViewAt(Int32)
Collapses the DetailsViewDataGrids corresponding to the specified record index.
Declaration
public void CollapseDetailsViewAt(int recordIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | recordIndex | Index of the record to collapse the Details View. |
CollapseGroup(Group)
Collapses the specified group in SfDataGrid.
Declaration
public void CollapseGroup(Group group)
Parameters
| Type | Name | Description |
|---|---|---|
| Group | group |
CollapseGroupsAtLevel(Int32)
Collapses the group based on its level.
Declaration
public void CollapseGroupsAtLevel(int groupLevel)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | groupLevel |
Deserialize(Stream)
Deserializes the SfDataGrid based on the XML document contained by the specified Stream.
Declaration
public void Deserialize(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | Specifies the System.IO.Stream that contains the XML document to deserialize. |
Deserialize(Stream, DataGridDeserializationOptions)
Deserializes the SfDataGrid based on the XML document of the specified Stream with DataGridDeserializationOptions.
Declaration
public void Deserialize(Stream stream, DataGridDeserializationOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | Specifies the System.IO.Stream that contains the XML document to deserialize. |
| DataGridDeserializationOptions | options | Specifies the |
EndEdit()
Ends the editing of the grid cell which is currently being edited.
Declaration
public void EndEdit()
ExpandAllDetailsView()
Expands all the DetailsViewDataGrids in the SfDataGrid.
Declaration
public void ExpandAllDetailsView()
ExpandAllDetailsView(Int32)
Expands the DetailsViewDataGrid corresponding up to specified level.
Declaration
public void ExpandAllDetailsView(int level)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | level | Specifies the level of the detailview. |
ExpandAllGroups()
Expands all the groups in SfDataGrid.
Declaration
public void ExpandAllGroups()
ExpandDetailsViewAt(Int32)
Expands the DetailsViewDataGrid corresponding to the specified record index.
Declaration
public bool ExpandDetailsViewAt(int recordIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | recordIndex | Index of the record to expand the Details View. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if the record is expanded. otherwise false. |
ExpandGroup(Group)
Expands the specified group in SfDataGrid.
Declaration
public void ExpandGroup(Group group)
Parameters
| Type | Name | Description |
|---|---|---|
| Group | group |
ExpandGroupsAtLevel(Int32)
Expands the group based on its level.
Declaration
public void ExpandGroupsAtLevel(int groupLevel)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | groupLevel |
GetRowGenerator()
Gets the current instance of the Syncfusion.Maui.DataGrid.SfDataGrid.RowGenerator in a SfDataGrid.
Declaration
public RowGenerator GetRowGenerator()
Returns
| Type |
|---|
| RowGenerator |
GetSelectedCells()
Gets the collection of selected cells in SfDataGrid.
Declaration
public List<SelectedCellInfo> GetSelectedCells()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<SelectedCellInfo> | Returns the collection of SelectedCellInfo that contains the selected cells in SfDataGrid. |
GetVisualContainer()
Gets the Syncfusion.Maui.DataGrid.SfDataGrid.VisualContainer that processes the scrolling related operations in SfDataGrid.
Declaration
public VisualContainer GetVisualContainer()
Returns
| Type |
|---|
| VisualContainer |
HideContextMenu()
Programmatically hides any currently visible context menu.
Declaration
public void HideContextMenu()
Remarks
This method can be used to manually dismiss the context menu, for example when performing operations that should cause the menu to close.
Examples
Here is an example of how to use the HideContextMenu() method.
[XAML]
<Button Text="Hide Context Menu"
Clicked="OnHideContextMenuClicked" />
[C#]
private void OnHideContextMenuClicked(object sender, EventArgs e)
{
// Hide the currently visible context menu
dataGrid.HideContextMenu();
}
InvalidateUnboundRow(DataGridUnboundRow, Boolean)
Declaration
public void InvalidateUnboundRow(DataGridUnboundRow unboundRow, bool canInvalidateColumn = true)
Parameters
| Type | Name | Description |
|---|---|---|
| DataGridUnboundRow | unboundRow | |
| System.Boolean | canInvalidateColumn |
MeasureContent(Double, Double)
ToDo
Declaration
protected override Size MeasureContent(double widthConstraint, double heightConstraint)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | widthConstraint | |
| System.Double | heightConstraint |
Returns
| Type |
|---|
| Microsoft.Maui.Graphics.Size |
Overrides
MoveCurrentCellTo(RowColumnIndex, Boolean)
Moves the currently focus cell to specified coordinates.
Declaration
public void MoveCurrentCellTo(RowColumnIndex rowColumnIndex, bool needToClearSelection = true)
Parameters
| Type | Name | Description |
|---|---|---|
| RowColumnIndex | rowColumnIndex | Specifies the corresponding row and column index to move the current cell to. |
| System.Boolean | needToClearSelection | bool value that determines whether the currently selected rows should be removed when the current cell is moved. |
OnContextMenuClosedEvent(ContextMenuClosedEventArgs)
Raises the ContextMenuClosed event.
Declaration
protected virtual void OnContextMenuClosedEvent(ContextMenuClosedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| ContextMenuClosedEventArgs | e | The event arguments. |
OnContextMenuItemClicked(ContextMenuItemClickedEventArgs)
Raises the ContextMenuItemClicked event.
Declaration
protected virtual void OnContextMenuItemClicked(ContextMenuItemClickedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| ContextMenuItemClickedEventArgs | e | The event arguments. |
OnContextMenuOpenedEvent(ContextMenuOpenedEventArgs)
Raises the ContextMenuOpened event.
Declaration
protected virtual void OnContextMenuOpenedEvent(ContextMenuOpenedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| ContextMenuOpenedEventArgs | e | The event arguments. |
OnContextMenuOpening(ContextMenuOpeningEventArgs)
Raises the ContextMenuOpening event.
Declaration
protected virtual void OnContextMenuOpening(ContextMenuOpeningEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| ContextMenuOpeningEventArgs | e | The event arguments. |
OnDraw(ICanvas, RectF)
Declaration
protected override void OnDraw(ICanvas canvas, RectF dirtyRect)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.Maui.Graphics.ICanvas | canvas | |
| Microsoft.Maui.Graphics.RectF | dirtyRect |
Overrides
OnHandlerChanged()
Invokes when the handler is changed in SfDataGrid
Declaration
protected override void OnHandlerChanged()
Overrides
OnPropertyChanged(String)
Called when the property of DataGrid is changed.
Declaration
protected override void OnPropertyChanged(string propertyName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | propertyName |
OpenToolTip(DataGridCell, Nullable<Point>)
Shows the tooltip for the given cell and pointer position.
Declaration
public void OpenToolTip(DataGridCell cell, Nullable<Point> position)
Parameters
| Type | Name | Description |
|---|---|---|
| DataGridCell | cell | The target cell. |
| System.Nullable<Microsoft.Maui.Graphics.Point> | position | The pointer/event position (nullable). |
RaiseQueryUnboundRow(DataGridUnboundRowEventArgs)
Declaration
protected DataGridUnboundRowEventArgs RaiseQueryUnboundRow(DataGridUnboundRowEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| DataGridUnboundRowEventArgs | args |
Returns
| Type |
|---|
| DataGridUnboundRowEventArgs |
Refresh()
Refresh the SfDataGrid in runtime.
Declaration
public void Refresh()
RefreshContainerAndView()
Refreshes the container and entire view of the SfDataGrid.
Declaration
public virtual void RefreshContainerAndView()
RefreshHeaderLineCount()
Refreshes the header line count in the SfDataGrid.
Declaration
public virtual void RefreshHeaderLineCount()
ResetSwipeOffset()
This method resets the swipe offset of the SfDataGrid. It will programmatically reset the swiping offset when there is no need to maintain the swipe state after navigating to another page.
Declaration
public void ResetSwipeOffset()
ResetUnboundRowIndex()
Declaration
protected void ResetUnboundRowIndex()
RowColumnIndexToPoint(RowColumnIndex)
Gets the point for the specified row column index in the given SfDataGrid.
Declaration
public Point RowColumnIndexToPoint(RowColumnIndex rowColumnIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| RowColumnIndex | rowColumnIndex |
Returns
| Type | Description |
|---|---|
| Microsoft.Maui.Graphics.Point | The point corresponding to the given row column index. |
ScrollToColumnIndex(Int32, ScrollToPosition, Boolean)
Scroll the SfDataGrid to the specified column index.
Declaration
public Task ScrollToColumnIndex(int columnIndex, ScrollToPosition scrollToColumnPosition, bool canAnimate = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | columnIndex | The zero-based index of the column to scroll to. |
| Microsoft.Maui.Controls.ScrollToPosition | scrollToColumnPosition | The position in the view to which the column should be scrolled. Default is Microsoft.Maui.Controls.ScrollToPosition.Start. |
| System.Boolean | canAnimate | Indicates whether the scrolling should be animated. Default is true. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | Returns the task that performs the scrolling asynchronously. |
Remarks
SfDataGrid supports programmatic scrolling. The user can scroll to the
required column by using this method.
See Also
ScrollToRowColumnIndex(Int32, Int32, ScrollToPosition, ScrollToPosition, Boolean)
Scroll the DataGrid to the specified row and column index.
Declaration
public Task ScrollToRowColumnIndex(int rowIndex, int columnIndex, ScrollToPosition scrollToRowPosition, ScrollToPosition scrollToColumnPosition, bool canAnimate = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowIndex | The zero-based index of the row to scroll to. |
| System.Int32 | columnIndex | The zero-based index of the column to scroll to. |
| Microsoft.Maui.Controls.ScrollToPosition | scrollToRowPosition | The position in the view to which the row should be scrolled. Default is Microsoft.Maui.Controls.ScrollToPosition.Start. |
| Microsoft.Maui.Controls.ScrollToPosition | scrollToColumnPosition | The position in the view to which the column should be scrolled. Default is Microsoft.Maui.Controls.ScrollToPosition.Start. |
| System.Boolean | canAnimate | Indicates whether the scrolling should be animated. Default is true. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | Returns the task that performs the scrolling asynchronously. |
Remarks
SfDataGrid supports programmatic scrolling. The user can scroll to the
required row and column by using this method.
See Also
ScrollToRowIndex(Int32, ScrollToPosition, Boolean)
Scroll the DataGrid to the specified row index.
Declaration
public Task ScrollToRowIndex(int rowIndex, ScrollToPosition scrollToRowPosition, bool canAnimate = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowIndex | The zero-based index of the column to scroll to. |
| Microsoft.Maui.Controls.ScrollToPosition | scrollToRowPosition | The position in the view to which the row should be scrolled. Default is Microsoft.Maui.Controls.ScrollToPosition.Start. |
| System.Boolean | canAnimate | Indicates whether the scrolling should be animated. Default is true. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | Returns the task that performs the scrolling asynchronously. |
Remarks
SfDataGrid supports programmatic scrolling. The user can scroll to the
required row by using this method.
See Also
SelectAll()
Selects all the cells in SfDataGrid when SelectionMode is Multiple.
Declaration
public void SelectAll()
SelectCell(Object, DataGridColumn)
Selects the cell that matches the specified row data and DataGridColumn.
Declaration
public void SelectCell(object rowData, DataGridColumn column)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | rowData | |
| DataGridColumn | column |
SelectCells(Object, DataGridColumn, Object, DataGridColumn)
Selects the range of cells that falls between the specified start/end row data and start/end DataGridColumn.
Declaration
public void SelectCells(object startRowData, DataGridColumn startColumn, object endRowData, DataGridColumn endColumn)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | startRowData | The data of the first row in the range of cells to be selected. |
| DataGridColumn | startColumn | The first DataGridColumn in the range of cells to be selected. |
| System.Object | endRowData | The data of the last row in the range of cells to be selected. |
| DataGridColumn | endColumn | The last DataGridColumn in the range of cells to be selected. |
Remarks
This method is applicable only when SelectionMode is Multiple.
Serialize(Stream)
Serializes the SfDataGrid control to the XML document file that are stored in the specified Stream.
Declaration
public void Serialize(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | Specifies the System.IO.Stream used to write the XML document file. |
Serialize(Stream, DataGridSerializationOptions)
Serializes the SfDataGrid with DataGridSerializationOptions to the XML document file that are stored in the specified Stream.
Declaration
public void Serialize(Stream stream, DataGridSerializationOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | Specifies stream used to write XML document file. |
| DataGridSerializationOptions | options | Specifies the DataGridSerializationOptions to decide the type of operations such as sorting, filtering, and etc to be serialized. |
ShowContextMenuAt(Int32, Int32)
Programmatically shows the context menu at the specified cell.
Declaration
public void ShowContextMenuAt(int rowIndex, int columnIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowIndex | The index of the row. |
| System.Int32 | columnIndex | The index of the column. |
Remarks
This method allows programmatic display of the context menu at a specific cell location. The cell type (header, data, etc.) is determined by the row index.
Examples
Here is an example of how to use the ShowContextMenuAt(Int32, Int32) method.
[XAML]
<Button Text=""Show Context Menu""
Clicked=""OnShowContextMenuClicked"" />
[C#]
private void OnShowContextMenuClicked(object sender, EventArgs e)
{
// Show context menu at row index 2 and column index 1
dataGrid.ShowContextMenuAt(2, 1);
}
Events
AddNewRowInitiating
Occurs when the add new row process is initiated.
Declaration
public event EventHandler<DataGridAddNewRowInitiatingEventArgs> AddNewRowInitiating
Event Type
| Type |
|---|
| System.EventHandler<DataGridAddNewRowInitiatingEventArgs> |
AutoGeneratingColumn
Occurs when column is generated for the properties from underlying data object.
Declaration
public event EventHandler<DataGridAutoGeneratingColumnEventArgs> AutoGeneratingColumn
Event Type
| Type |
|---|
| System.EventHandler<DataGridAutoGeneratingColumnEventArgs> |
AutoGeneratingRelations
Occurs when the relations for Master-Details View is generated automatically.
Declaration
public event EventHandler<DataGridAutoGeneratingRelationsArgs> AutoGeneratingRelations
Event Type
| Type |
|---|
| System.EventHandler<DataGridAutoGeneratingRelationsArgs> |
CellDoubleTapped
Occurs when the cell is tapped twice.
Declaration
public event EventHandler<DataGridCellDoubleTappedEventArgs> CellDoubleTapped
Event Type
| Type |
|---|
| System.EventHandler<DataGridCellDoubleTappedEventArgs> |
CellEntered
Occurs when the mouse is entered to the cell.
Declaration
public event EventHandler<DataGridCellEnteredEventArgs> CellEntered
Event Type
| Type |
|---|
| System.EventHandler<DataGridCellEnteredEventArgs> |
CellExited
Occurs when the mouse is exited from the cell.
Declaration
public event EventHandler<DataGridCellExitedEventArgs> CellExited
Event Type
| Type |
|---|
| System.EventHandler<DataGridCellExitedEventArgs> |
CellHovered
Occurs when the mouse is hovered in the cell.
Declaration
public event EventHandler<DataGridCellHoveredEventArgs> CellHovered
Event Type
| Type |
|---|
| System.EventHandler<DataGridCellHoveredEventArgs> |
CellLongPress
Occurs when the cell is long pressed for particular period.
Declaration
public event EventHandler<DataGridCellLongPressEventArgs> CellLongPress
Event Type
| Type |
|---|
| System.EventHandler<DataGridCellLongPressEventArgs> |
CellRightTapped
Occurs when a cell in the data grid is right-clicked using the mouse.
Declaration
public event EventHandler<DataGridCellRightTappedEventArgs> CellRightTapped
Event Type
| Type |
|---|
| System.EventHandler<DataGridCellRightTappedEventArgs> |
Remarks
This event is raised when the user performs a right-click action on a cell using the mouse. It is applicable only on the Windows and Mac Catalyst platforms.
CellTapped
Occurs when the cell is tapped.
Declaration
public event EventHandler<DataGridCellTappedEventArgs> CellTapped
Event Type
| Type |
|---|
| System.EventHandler<DataGridCellTappedEventArgs> |
CellToolTipOpening
Occurs when a tooltip is about to be opened for a cell in the SfDataGrid.
Declaration
public event EventHandler<DataGridCellToolTipOpeningEventArgs> CellToolTipOpening
Event Type
| Type |
|---|
| System.EventHandler<DataGridCellToolTipOpeningEventArgs> |
CellValidated
Occurs when the current cell is validated.
Declaration
public event EventHandler<DataGridCellValidatedEventArgs> CellValidated
Event Type
| Type |
|---|
| System.EventHandler<DataGridCellValidatedEventArgs> |
Remarks
This event occurs after the
CellValidating
Occurs while moving to other cells from edited cell for validating the user input.
Declaration
public event EventHandler<DataGridCellValidatingEventArgs> CellValidating
Event Type
| Type |
|---|
| System.EventHandler<DataGridCellValidatingEventArgs> |
Remarks
You can cancel or customize the current cell being validated through the DataGridCellValidatingEventArgs event argument.
CellValueChanged
Occurs when the cell value is changed.
Declaration
public event EventHandler<DataGridCellValueChangedEventArgs> CellValueChanged
Event Type
| Type |
|---|
| System.EventHandler<DataGridCellValueChangedEventArgs> |
Remarks
As of now, this event will be triggered for the DataGridCheckBoxColumn. This event won’t be triggered when you change the value of underlying data programmatically.
ColumnResizing
Occurs when a column's width is being resized in SfDataGrid.
Declaration
public event EventHandler<DataGridColumnResizingEventArgs> ColumnResizing
Event Type
| Type |
|---|
| System.EventHandler<DataGridColumnResizingEventArgs> |
ContextMenuClosed
Occurs when a context menu has been closed.
Declaration
public event EventHandler<ContextMenuClosedEventArgs> ContextMenuClosed
Event Type
| Type |
|---|
| System.EventHandler<ContextMenuClosedEventArgs> |
Remarks
This event is fired after the context menu is fully closed. This can be used to perform cleanup or update UI elements after a menu is dismissed.
Examples
Here is an example of how to handle the ContextMenuClosed event.
[XAML]
<syncfusion:SfDataGrid x:Name=""dataGrid""
ItemsSource=""{Binding YourData}""
AutoGenerateColumns=""True""
ContextMenuClosed=""DataGrid_ContextMenuClosed"" />
[C#]
private void DataGrid_ContextMenuClosed(object sender, ContextMenuClosedEventArgs e)
{
Console.WriteLine(""Context menu closed."");
}
ContextMenuClosing
Occurs when a context menu is about to be closed.
Declaration
public event EventHandler<ContextMenuClosingEventArgs> ContextMenuClosing
Event Type
| Type |
|---|
| System.EventHandler<ContextMenuClosingEventArgs> |
Remarks
This event is fired before the context menu is closed, allowing operations to be performed or to cancel the closing.
Examples
Here is an example of how to handle the ContextMenuClosing event.
[XAML]
<syncfusion:SfDataGrid x:Name=""dataGrid""
ItemsSource=""{Binding YourData}""
AutoGenerateColumns=""True""
ContextMenuClosing=""DataGrid_ContextMenuClosing"" />
[C#]
private void DataGrid_ContextMenuClosing(object sender, ContextMenuClosingEventArgs e)
{
// Perform cleanup or validation before the menu closes
if (e.MenuItems.Any(item => item.Text == ""Delete""))
{
// Optionally cancel closing if needed
// e.Cancel = true;
}
}
ContextMenuItemClicked
Occurs when a context menu item is clicked.
Declaration
public event EventHandler<ContextMenuItemClickedEventArgs> ContextMenuItemClicked
Event Type
| Type |
|---|
| System.EventHandler<ContextMenuItemClickedEventArgs> |
Remarks
This event is fired when the user selects an item from the context menu. The event arguments provide information about the clicked menu item.
Examples
Here is an example of how to handle the ContextMenuItemClicked event.
[XAML]
<syncfusion:SfDataGrid x:Name=""dataGrid""
ItemsSource=""{Binding YourData}""
AutoGenerateColumns=""True""
ContextMenuItemClicked=""DataGrid_ContextMenuItemClicked"" />
[C#]
private void DataGrid_ContextMenuItemClicked(object sender, ContextMenuItemClickedEventArgs e)
{
// Handle the clicked menu item
var clickedItem = e.MenuItem;
Console.WriteLine($""Clicked Menu Item: {clickedItem.Text}"");
}
ContextMenuOpened
Occurs when a context menu has been opened.
Declaration
public event EventHandler<ContextMenuOpenedEventArgs> ContextMenuOpened
Event Type
| Type |
|---|
| System.EventHandler<ContextMenuOpenedEventArgs> |
Remarks
This event is fired after the context menu is fully displayed. The event arguments provide information about the displayed menu, including the associated column and the menu items that are being shown.
Examples
Here is an example of how to handle the ContextMenuOpened event.
[XAML]
<syncfusion:SfDataGrid x:Name=""dataGrid""
ItemsSource=""{Binding YourData}""
AutoGenerateColumns=""True""
ContextMenuOpened=""DataGrid_ContextMenuOpened"" />
[C#]
private void DataGrid_ContextMenuOpened(object sender, ContextMenuOpenedEventArgs e)
{
// Inspect or log the opened menu items
foreach (var item in e.MenuItems)
{
Console.WriteLine($""Menu Item: {item.Text}"");
}
}
ContextMenuOpening
Occurs when a context menu is about to be opened.
Declaration
public event EventHandler<ContextMenuOpeningEventArgs> ContextMenuOpening
Event Type
| Type |
|---|
| System.EventHandler<ContextMenuOpeningEventArgs> |
Remarks
This event allows customization of menu items before the context menu is displayed. The event arguments provide access to the menu items and allow cancellation of the menu display.
Examples
Here is an example of how to handle the ContextMenuOpening event.
[XAML]
<syncfusion:SfDataGrid x:Name=""dataGrid""
ItemsSource=""{Binding YourData}""
AutoGenerateColumns=""True""
ContextMenuOpening=""DataGrid_ContextMenuOpening"" />
[C#]
private void DataGrid_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
{
// Customize or cancel the context menu
if (e.MenuItems != null)
{
e.MenuItems.Add(new MenuItem { Text = ""Custom Action"", Command = ViewModel.CustomCommand });
}
// Optionally cancel the menu
// e.Cancel = true;
}
CopyCellContent
Occurs when each cell in the selected cells or rows being copied from SfDataGrid into clipboard.
Declaration
public event EventHandler<DataGridCopyPasteCellEventArgs> CopyCellContent
Event Type
| Type |
|---|
| System.EventHandler<DataGridCopyPasteCellEventArgs> |
CopyContent
Occurs when the selected cells or rows in SfDataGrid is being copied in to clipboard.
Declaration
public event EventHandler<DataGridCopyPasteEventArgs> CopyContent
Event Type
| Type |
|---|
| System.EventHandler<DataGridCopyPasteEventArgs> |
CurrentCellActivated
Occurs when the cell is activated on tapping or navigation.
Declaration
public event EventHandler<DataGridCurrentCellActivatedEventArgs> CurrentCellActivated
Event Type
| Type |
|---|
| System.EventHandler<DataGridCurrentCellActivatedEventArgs> |
CurrentCellActivating
Occurs when the cell is being activated on tapping or navigation.
Declaration
public event EventHandler<DataGridCurrentCellActivatingEventArgs> CurrentCellActivating
Event Type
| Type |
|---|
| System.EventHandler<DataGridCurrentCellActivatingEventArgs> |
CurrentCellBeginEdit
Occurs when the current cell enters into edit mode in SfDataGrid.
Declaration
public event EventHandler<DataGridCurrentCellBeginEditEventArgs> CurrentCellBeginEdit
Event Type
| Type |
|---|
| System.EventHandler<DataGridCurrentCellBeginEditEventArgs> |
CurrentCellDropDownSelectionChanged
Occurs when the SelectedItem changed in the drop down of GridMultiColumnDropDownList or GridComboBoxColumn.
Declaration
public event EventHandler<CurrentCellDropDownSelectionChangedEventArgs> CurrentCellDropDownSelectionChanged
Event Type
| Type |
|---|
| System.EventHandler<CurrentCellDropDownSelectionChangedEventArgs> |
CurrentCellEndEdit
Occurs when the current cell exists the edit mode in SfDataGrid.
Declaration
public event EventHandler<DataGridCurrentCellEndEditEventArgs> CurrentCellEndEdit
Event Type
| Type |
|---|
| System.EventHandler<DataGridCurrentCellEndEditEventArgs> |
DataGridLoaded
Occurs when the SfDataGrid is loaded.
Declaration
public event EventHandler DataGridLoaded
Event Type
| Type |
|---|
| System.EventHandler |
DetailsViewCollapsed
Occurs after the DetailsViewDataGrid is collapsed.
Declaration
public event EventHandler<DataGridDetailsViewCollapsedEventArgs> DetailsViewCollapsed
Event Type
| Type |
|---|
| System.EventHandler<DataGridDetailsViewCollapsedEventArgs> |
DetailsViewCollapsing
Occurs when the DetailsViewDataGrid is being collapsed.
Declaration
public event EventHandler<DataGridDetailsViewCollapsingEventArgs> DetailsViewCollapsing
Event Type
| Type |
|---|
| System.EventHandler<DataGridDetailsViewCollapsingEventArgs> |
DetailsViewExpanded
Occurs after the DetailsViewDataGrid is expanded.
Declaration
public event EventHandler<DataGridDetailsViewExpandedEventArgs> DetailsViewExpanded
Event Type
| Type |
|---|
| System.EventHandler<DataGridDetailsViewExpandedEventArgs> |
DetailsViewExpanding
Occurs when the DetailsViewDataGrid is being expanded.
Declaration
public event EventHandler<DataGridDetailsViewExpandingEventArgs> DetailsViewExpanding
Event Type
| Type |
|---|
| System.EventHandler<DataGridDetailsViewExpandingEventArgs> |
DetailsViewLoading
Occurs when the DetailsViewDataGrid is being loaded in to view.
Declaration
public event EventHandler<DataGridDetailsViewLoadingEventArgs> DetailsViewLoading
Event Type
| Type |
|---|
| System.EventHandler<DataGridDetailsViewLoadingEventArgs> |
DetailsViewUnloading
Occurs when the DetailsViewDataGrid is being unloaded from the view.
Declaration
public event EventHandler<DataGridDetailsViewUnloadingEventArgs> DetailsViewUnloading
Event Type
| Type |
|---|
| System.EventHandler<DataGridDetailsViewUnloadingEventArgs> |
GroupCollapsed
Occurs when a group is collapsed in SfDataGrid.
Declaration
public event EventHandler<DataGridColumnGroupChangedEventArgs> GroupCollapsed
Event Type
| Type |
|---|
| System.EventHandler<DataGridColumnGroupChangedEventArgs> |
GroupCollapsing
Occurs when a group is being collapsed in SfDataGrid.
Declaration
public event EventHandler<DataGridColumnGroupChangingEventArgs> GroupCollapsing
Event Type
| Type |
|---|
| System.EventHandler<DataGridColumnGroupChangingEventArgs> |
GroupExpanded
Occurs when a group is expanded in SfDataGrid.
Declaration
public event EventHandler<DataGridColumnGroupChangedEventArgs> GroupExpanded
Event Type
| Type |
|---|
| System.EventHandler<DataGridColumnGroupChangedEventArgs> |
GroupExpanding
Occurs when a group is being expanded in SfDataGrid.
Declaration
public event EventHandler<DataGridColumnGroupChangingEventArgs> GroupExpanding
Event Type
| Type |
|---|
| System.EventHandler<DataGridColumnGroupChangingEventArgs> |
ItemsSourceChanged
Occurs when the source is changed in the SfDataGrid.
Declaration
public event EventHandler<DataGridItemsSourceChangedEventArgs> ItemsSourceChanged
Event Type
| Type |
|---|
| System.EventHandler<DataGridItemsSourceChangedEventArgs> |
PasteCellContent
Occurs when each cell is being pasted from clipboard to SfDataGrid control.
Declaration
public event EventHandler<DataGridCopyPasteCellEventArgs> PasteCellContent
Event Type
| Type |
|---|
| System.EventHandler<DataGridCopyPasteCellEventArgs> |
PasteContent
Occurs when the clipboard value is being pasted to SfDataGrid.
Declaration
public event EventHandler<DataGridCopyPasteEventArgs> PasteContent
Event Type
| Type |
|---|
| System.EventHandler<DataGridCopyPasteEventArgs> |
QueryColumnDragging
Declaration
public event EventHandler<DataGridQueryColumnDraggingEventArgs> QueryColumnDragging
Event Type
| Type |
|---|
| System.EventHandler<DataGridQueryColumnDraggingEventArgs> |
QueryRowDragging
Occurs when a row is being reordering to the new position in SfDataGrid.
Declaration
public event EventHandler<DataGridQueryRowDraggingEventArgs> QueryRowDragging
Event Type
| Type |
|---|
| System.EventHandler<DataGridQueryRowDraggingEventArgs> |
QueryRowHeight
Occurs when the height of the rows is queried.
Declaration
public event EventHandler<DataGridQueryRowHeightEventArgs> QueryRowHeight
Event Type
| Type |
|---|
| System.EventHandler<DataGridQueryRowHeightEventArgs> |
QueryUnboundColumnValue
Occurs to query the values for DataGridUnboundColumn when the cells are initialized.
Declaration
public event EventHandler<DataGridUnboundColumnEventArgs> QueryUnboundColumnValue
Event Type
| Type |
|---|
| System.EventHandler<DataGridUnboundColumnEventArgs> |
QueryUnboundRow
Occurs to query and commit the values to the unbound row.
Declaration
public event EventHandler<DataGridUnboundRowEventArgs> QueryUnboundRow
Event Type
| Type |
|---|
| System.EventHandler<DataGridUnboundRowEventArgs> |
Examples
dataGrid.QueryUnboundRow += DataGrid_QueryUnboundRow;
void DataGrid_QueryUnboundRow(object sender, DataGridUnboundRowEventArgs e)
{
if (e.DataGridUnboundAction == UnboundActions.QueryData)
{
if (e.RowColumnIndex.ColumnIndex == 0)
{
e.Value = (dataGrid.CurrentItem as OrderInfo).OrderID;
e.Handled = true;
}
}
}
RowValidated
Occurs after the row is validated.
Declaration
public event EventHandler<DataGridRowValidatedEventArgs> RowValidated
Event Type
| Type |
|---|
| System.EventHandler<DataGridRowValidatedEventArgs> |
Remarks
This event occurs after the
RowValidating
Occurs while the moving from the edited row to validate the user input.
Declaration
public event EventHandler<DataGridRowValidatingEventArgs> RowValidating
Event Type
| Type |
|---|
| System.EventHandler<DataGridRowValidatingEventArgs> |
Remarks
You can cancel or customize the row is being validated through the DataGridRowValidatingEventArgs event argument.
SelectionChanged
Occurs when the selection is applied to rows.
Declaration
public event EventHandler<DataGridSelectionChangedEventArgs> SelectionChanged
Event Type
| Type |
|---|
| System.EventHandler<DataGridSelectionChangedEventArgs> |
SelectionChanging
Occurs when the selection is being applied to rows.
Declaration
public event EventHandler<DataGridSelectionChangingEventArgs> SelectionChanging
Event Type
| Type |
|---|
| System.EventHandler<DataGridSelectionChangingEventArgs> |
SortColumnsChanged
Occurs when column is sorted.
Declaration
public event EventHandler<DataGridSortColumnsChangedEventArgs> SortColumnsChanged
Event Type
| Type |
|---|
| System.EventHandler<DataGridSortColumnsChangedEventArgs> |
SortColumnsChanging
Occurs when column is being sorted.
Declaration
public event EventHandler<DataGridSortColumnsChangingEventArgs> SortColumnsChanging
Event Type
| Type |
|---|
| System.EventHandler<DataGridSortColumnsChangingEventArgs> |
SwipeEnded
Occurs when the swiping is ended in SfDataGrid.
Declaration
public event EventHandler<DataGridSwipeEndedEventArgs> SwipeEnded
Event Type
| Type |
|---|
| System.EventHandler<DataGridSwipeEndedEventArgs> |
Examples
The following example demonstrates how to register and handle the SwipeEnded event:
SfDataGrid dataGrid = new SfDataGrid();
dataGrid.SwipeEnded += DataGrid_SwipeEnded;
private void DataGrid_SwipeEnded(object? sender, DataGridSwipeEndedEventArgs e)
{
// Retrieve additional information about the swipe.
var rowData = e.RowData;
var index = e.RowIndex;
var offSet = e.SwipeOffset;
var direction = e.SwipeDirection;
}
See Also
SwipeStarting
Occurs when a swiping action starts in the SfDataGrid.
Declaration
public event EventHandler<DataGridSwipeStartingEventArgs> SwipeStarting
Event Type
| Type |
|---|
| System.EventHandler<DataGridSwipeStartingEventArgs> |
Examples
Here is an example of how to register the SwipeStarting event.
SfDataGrid dataGrid = new SfDataGrid();
dataGrid.SwipeStarting += DataGrid_SwipeStarting;
private void DataGrid_SwipeStarting(object? sender, DataGridSwipeStartingEventArgs e)
{
// Optionally cancel the swipe operation.
e.Cancel = false;
// Retrieve additional information about the swipe.
var rowData = e.RowData;
var index = e.RowIndex;
var offSet = e.SwipeOffset;
var direction = e.SwipeDirection;
}
See Also
Swiping
Occurs during an ongoing swipe action in the SfDataGrid.
Declaration
public event EventHandler<DataGridSwipingEventArgs> Swiping
Event Type
| Type |
|---|
| System.EventHandler<DataGridSwipingEventArgs> |
Examples
The following example demonstrates how to register and handle the Swiping event:
SfDataGrid dataGrid = new SfDataGrid();
dataGrid.Swiping += DataGrid_Swiping;
private void DataGrid_Swiping(object? sender, DataGridSwipingEventArgs e)
{
// Retrieve additional information about the swipe.
var rowData = e.RowData;
var index = e.RowIndex;
var offSet = e.SwipeOffset;
var direction = e.SwipeDirection;
}
See Also
ViewCreated
Occurs when the view for a SfDataGrid is created.
Declaration
public event EventHandler ViewCreated
Event Type
| Type |
|---|
| System.EventHandler |