Class SfDataGrid
A data bound list control that displays the items from data source in a tabular view. The SfDataGrid control allows you to select, sort and group these items.
Inheritance
Namespace: Syncfusion.SfDataGrid.XForms
Assembly: Syncfusion.SfDataGrid.XForms.dll
Syntax
public class SfDataGrid : Grid, IDisposable, IPullToRefresh, IParentThemeElement, IThemeElement
Remarks
The SfDataGrid control provides a flexible way to display a collection of data in rows and columns. The SfDataGrid includes built-in column types and a template column for hosting custom Content.
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
AllowColumnSelectionProperty
Identifies the AllowColumnSelection Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AllowColumnSelectionProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
AllowDeletingProperty
Identifies the AllowDeleting Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AllowDeletingProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AllowDiagonalScrollingProperty
Identifies the AllowDiagonalScrolling Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AllowDiagonalScrollingProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AllowDraggingColumnProperty
Identifies the AllowDraggingColumn Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AllowDraggingColumnProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AllowDraggingRowProperty
Identifies the AllowDraggingRow Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AllowDraggingRowProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AllowEditingProperty
Identifies the AllowEditing Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AllowEditingProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AllowGroupExpandCollapseProperty
Identifies the AllowGroupExpandAndCollapse Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AllowGroupExpandCollapseProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AllowKeyboardNavigationProperty
Identifies the AllowKeyboardNavigation Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AllowKeyboardNavigationProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AllowLoadMoreProperty
Identifies the AllowLoadMore Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AllowLoadMoreProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AllowMultiSortingProperty
Identifies the AllowMultiSorting Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AllowMultiSortingProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AllowPullToRefreshProperty
Identifies the AllowPullToRefresh Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AllowPullToRefreshProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AllowResizingColumnProperty
Identifies the AllowResizingColumn Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AllowResizingColumnProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AllowSortingProperty
Identifies the AllowSorting Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AllowSortingProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AllowSwipingProperty
Identifies the AllowSwiping Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AllowSwipingProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AllowTriStateSortingProperty
Identifies the AllowTriStateSorting Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AllowTriStateSortingProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AllowZoomingProperty
Identifies the AllowZooming bindable property.
Declaration
public static readonly BindableProperty AllowZoomingProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
AlternationCountProperty
Identifies the AlternationCount Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AlternationCountProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AutoExpandGroupsProperty
Identifies the AutoExpandGroups Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AutoExpandGroupsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AutoGenerateColumnsForCustomTypeProperty
Identifies the AutoGenerateColumnsForCustomType Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AutoGenerateColumnsForCustomTypeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AutoGenerateColumnsModeForCustomTypeProperty
Identifies the AutoGenerateColumnsModeForCustomType Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AutoGenerateColumnsModeForCustomTypeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AutoGenerateColumnsModeProperty
Identifies the AutoGenerateColumnsMode Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AutoGenerateColumnsModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
AutoGenerateColumnsProperty
Identifies the AutoGenerateColumns Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AutoGenerateColumnsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
CanMaintainScrollPositionProperty
Identifies the Syncfusion.SfDataGrid.XForms.CanMaintainScrollPosition bindable property.
Declaration
public static readonly BindableProperty CanMaintainScrollPositionProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
The identifier for the Syncfusion.SfDataGrid.XForms.CanMaintainScrollPosition bindable property.
CanUseViewFilterProperty
Identifies the Syncfusion.SfDataGrid.XForms.CanUseRowFilter bindable property.
Declaration
public static readonly BindableProperty CanUseViewFilterProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
The identifier for the Syncfusion.SfDataGrid.XForms.CanUseRowFilter bindable property.
CaptionSummaryRowProperty
Identifies the CaptionSummaryRow Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty CaptionSummaryRowProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
CaptionSummaryTemplateProperty
Identifies the CaptionSummaryTemplate Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty CaptionSummaryTemplateProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
CellRenderersProperty
Identifies the CellRenderers Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty CellRenderersProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
ColumnSizerProperty
Identifies the ColumnSizer Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty ColumnSizerProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
ColumnsProperty
Identifies the Columns Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty ColumnsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
CurrentItemProperty
Identifies the CurrentItem Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty CurrentItemProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
DataFetchSizeProperty
Identifies the DataFetchSize Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty DataFetchSizeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
DefaultColumnWidthProperty
Identifies the DefaultColumnWidth Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty DefaultColumnWidthProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
EditorSelectionBehaviorProperty
Identifies the EditorSelectionBehavior Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty EditorSelectionBehaviorProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
EditTapActionProperty
Identifies the TapAction Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty EditTapActionProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
EnableDataVirtualizationProperty
Identifies the EnableDataVirtualization Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty EnableDataVirtualizationProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
The identifier for the EnableDataVirtualization Xamarin.Forms.BindableProperty.
FrozenColumnsCountProperty
Identifies the FrozenColumnsCount Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty FrozenColumnsCountProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
FrozenRowsCountProperty
Identifies the FrozenRowsCount Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty FrozenRowsCountProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
GridDoubleTappedCommandProperty
Identifies the GridDoubleTappedCommand Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty GridDoubleTappedCommandProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
GridLongPressedCommandProperty
Identifies the GridLongPressedCommand Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty GridLongPressedCommandProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
GridStyleProperty
Identifies the GridStyle Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty GridStyleProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
GridTappedCommandProperty
Identifies the GridTappedCommand Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty GridTappedCommandProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
GroupCaptionTextFormatProperty
Identifies the GroupCaptionTextFormat Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty GroupCaptionTextFormatProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
GroupColumnDescriptionsProperty
Identifies the GroupColumnDescriptions Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty GroupColumnDescriptionsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
GroupingModeProperty
Identifies the GroupingMode Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty GroupingModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
GroupSummaryRowsProperty
Identifies the GroupSummaryRows Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty GroupSummaryRowsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
GroupSummaryTemplateProperty
Identifies the GroupSummaryTemplate Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty GroupSummaryTemplateProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
HeaderRowHeightProperty
Identifies the HeaderRowHeight Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty HeaderRowHeightProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
HorizontalScrollBarVisibilityProperty
Identifies the HorizontalScrollBarVisibility bindable property.
Declaration
public static readonly BindableProperty HorizontalScrollBarVisibilityProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
IndentColumnWidthProperty
Identifies the IndentColumnWidth Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty IndentColumnWidthProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
IsBusyProperty
Identifies the IsBusy Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty IsBusyProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
ItemsSourceProperty
Identifies the ItemsSource Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty ItemsSourceProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
LeftSwipeTemplateProperty
Identifies the LeftSwipeTemplate Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty LeftSwipeTemplateProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
LiveDataUpdateModeProperty
Identifies the LiveDataUpdateMode Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty LiveDataUpdateModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read only.
LoadMoreCommandProperty
Identifies the LoadMoreCommand Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty LoadMoreCommandProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
LoadMorePositionProperty
Identifies the LoadMorePosition Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty LoadMorePositionProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
LoadMoreViewProperty
Identifies the LoadMoreView Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty LoadMoreViewProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
LostFocusBehaviorProperty
Identifies the LostFocusBehavior Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty LostFocusBehaviorProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
MaximumZoomScaleProperty
Identifies the MaximumZoomScale bindable property.
Declaration
public static readonly BindableProperty MaximumZoomScaleProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
MaxSwipeOffsetProperty
Identifies the MaxSwipeOffset Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty MaxSwipeOffsetProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
MinimumZoomScaleProperty
Identifies the MinimumZoomScale bindable property.
Declaration
public static readonly BindableProperty MinimumZoomScaleProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
NavigationModeProperty
Identifies the NavigationMode Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty NavigationModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This is Xamarin.Forms.BindableProperty is read-only.
NotificationSubscriptionModeProperty
Identifies the NotificationSubscriptionMode Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty NotificationSubscriptionModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
PullToRefreshCommandProperty
Identifies the PullToRefreshCommand Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty PullToRefreshCommandProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
PullToRefreshViewProperty
Identifies the PullToRefreshView Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty PullToRefreshViewProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
ResizingModeProperty
Identifies the ResizingMode Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty ResizingModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
ReuseRowsOnItemsSourceChangeProperty
Identifies the Syncfusion.SfDataGrid.XForms.ReuseRowsOnItemsSourceChange bindable property.
Declaration
public static readonly BindableProperty ReuseRowsOnItemsSourceChangeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
RightSwipeTemplateProperty
Identifies the RightSwipeTemplate Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty RightSwipeTemplateProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
RowDragDropTemplateProperty
Identifies the RowDragDropTemplate Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty RowDragDropTemplateProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
RowHeaderTemplateProperty
Identifies the RowHeaderTemplate Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty RowHeaderTemplateProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
RowHeaderWidthProperty
Identifies the RowHeaderWidth Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty RowHeaderWidthProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
RowHeightProperty
Identifies the RowHeight Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty RowHeightProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
ScrollingModeProperty
Identifies the ScrollingMode Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty ScrollingModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
SelectedIndexProperty
Identifies the SelectedIndex Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty SelectedIndexProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
SelectedItemProperty
Identifies the SelectedItem Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty SelectedItemProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
SelectedItemsProperty
Identifies the SelectedItems Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty SelectedItemsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
SelectionControllerProperty
Identifies the SelectionController Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty SelectionControllerProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
SelectionModeProperty
Identifies the SelectionMode Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty SelectionModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
SelectionUnitProperty
Identifies the SelectionUnit Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty SelectionUnitProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ShowColumnWhenGroupedProperty
Identifies the ShowColumnWhenGrouped Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty ShowColumnWhenGroupedProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
ShowRowHeaderProperty
Identifies the ShowRowHeader Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty ShowRowHeaderProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
SortColumnDescriptionsProperty
Identifies the SortColumnDescriptions Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty SortColumnDescriptionsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
SortComparersProperty
Identifies the SortComparers Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty SortComparersProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
SortTapActionProperty
Identifies the SortTapAction Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty SortTapActionProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
SourceTypeProperty
Identifies the SourceType Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty SourceTypeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
StackedHeaderRowsProperty
Identifies the StackedHeaderRowCollection dependency property.
Declaration
public static readonly BindableProperty StackedHeaderRowsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
The identifier for the StackedHeaderRowCollection dependency property.
SummaryCalculationModeProperty
Identifies the CaptionSummaryTemplate Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty SummaryCalculationModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
SwipeOffsetModeProperty
Identifies the SwipeOffsetMode Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty SwipeOffsetModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
TableSummaryRowsProperty
Identifies the TableSummaryRows Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty TableSummaryRowsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
TableSummaryTemplateProperty
Identifies the TableSummaryTemplate Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty TableSummaryTemplateProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
UnboundRowsProperty
Identifies the UnboundRows dependency property.
Declaration
public static readonly BindableProperty UnboundRowsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
The identifier for the UnboundRows dependency property.
VerticalOverScrollModeProperty
Identifies the VerticalOverScrollMode Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty VerticalOverScrollModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
VerticalScrollBarVisibilityProperty
Identifies the VerticalScrollBarVisibility bindable property.
Declaration
public static readonly BindableProperty VerticalScrollBarVisibilityProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
ViewProperty
Identifies the View Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty ViewProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
Properties
AllowColumnSelection
Gets or sets a value indicating whether an entire column can be selected by tapping or double tapping the column headers in SfDataGrid control.
Declaration
public bool AllowColumnSelection { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false. |
Remarks
Setting true to this property enables the column selection functionality.
Examples
dataGrid.AllowColumnSelection = true;
AllowDeleting
Gets or sets a value indicating whether the user can delete the record rows by pressing Delete key in SfDataGrid control.
Declaration
public bool AllowDeleting { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true. |
Remarks
Setting false to this property disables the delete functionality. Applicable only for UWP and MacOS platforms.
Examples
dataGrid.AllowDeleting = false;
AllowDiagonalScrolling
Gets or sets a value indicating whether to enable/disable the diagonal scrolling in the SfDataGrid control.
Declaration
public bool AllowDiagonalScrolling { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true. |
Remarks
Setting false to this property enables scrolling either in horizontal or vertical direction but not simultaneously. This property does not have an effect on WPF platform.
Examples
dataGrid.AllowDiagonalScrolling = false;
AllowDraggingColumn
Gets or sets a value indicating whether to enable/disable the column dragging functionality in a SfDataGrid control. SfDataGrid allows you to drag and drop a column header by enabling this property.
Declaration
public bool AllowDraggingColumn { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if column dragging is enabled, otherwise false. The default value is false. |
Remarks
SfDataGrid allows you to drag and drop a column header by setting the AllowDraggingColumn property to true. Drag view is displayed while dragging a column header. The drag and drop operation can be handled based on the requirement using QueryColumnDragging event.
Examples
dataGrid.AllowDraggingColumn = true;
See Also
AllowDraggingRow
Gets or sets a value indicating whether to enable/disable the row dragging functionality in a SfDataGrid control. SfDataGrid also allows you to customize the row drag and drop popup using the RowDragDropTemplate property.
Declaration
public bool AllowDraggingRow { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if row dragging is enabled, otherwise false. The default value is false. |
Remarks
SfDataGrid allows you to drag and drop a row by setting the AllowDraggingRow property to true. A customizable row drag and drop template is displayed while dragging a row. The drag and drop operation can be handled based on the requirement using QueryRowDragging event.
Examples
dataGrid.AllowDraggingRow = true;
See Also
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 | Description |
---|---|
System.Boolean | True if editing is enabled, otherwise false. The default value is false. |
Examples
dataGrid.AllowEditing = true;
See Also
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
public bool AllowGroupExpandCollapse { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if expand and collapse groups is enabled, otherwise false. The default value is false. |
Examples
this.dataGrid.AllowGroupExpandCollapse = true;
See Also
AllowKeyboardNavigation
Gets or sets a value indicating whether to allow the navigation of rows using keyboard in SfDataGrid control. SfDataGrid.
Declaration
public bool AllowKeyboardNavigation { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True If navigation of rows is enabled, otherwise false. The default value is true for UWP desktop, iOS and false for MAC OS. |
Examples
dataGrid.AllowKeyboardNavigation = false;
AllowLoadMore
Gets or sets a value indicating whether to enable/disable the load more option for adding more records in runtime, when the grid is scrolled to the last record of the collection. On enabling this property, SfDataGrid provides an option to add more items to the underlying collection when the LoadMoreView is tapped, by executing the LoadMoreCommand and hence it is mandatory to set the property too for enabling the load more option.
Declaration
public bool AllowLoadMore { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True, if load more is enabled, otherwise false. The default value is false. |
Remarks
SfDataGrid provides an option to load more items in runtime, when the grid is scrolled to the last record of the collection. A command will be fired when the LoadMoreView is tapped and it can be used to add more items to the underlying data. To enable the load more feature, you must set the AllowLoadMore to true and also must set the LoadMoreCommand property. By default, a button will be displayed when the grid is scrolled to the last record. However, SfDataGrid allows you to customize this view based on the requirement using LoadMoreView property.
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;
}
See Also
AllowMultiSorting
Gets or sets a value indicating whether to enable multi sorting or not. By enabling the multi sorting, SfDataGrid allows the user to sort the data against more than one columns.
Declaration
public bool AllowMultiSorting { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if multi sorting is enabled, otherwise false. The default value is false. |
Remarks
SfDataGrid allows multiple sorting by which the underlying data can be sorted by more than one columns. To apply sorting for multiple columns, tap the desired column headers after setting the AllowMultiSorting property to true.
Examples
dataGrid.AllowMultiSorting = true;
See Also
AllowPullToRefresh
Gets or sets a value indicating whether to enable/disable the refreshing option upon pulling the grid. On enabling this property, SfDataGrid provides an option to refresh it when performing the pulling action. The refreshing can be done using the PullToRefreshCommand and hence it is mandatory to set the property too for enabling the refreshing option.
Declaration
public bool AllowPullToRefresh { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if pull to refresh is enabled, otherwise False. By default, value is false. |
Remarks
SfDataGrid provides an option to refresh it when performing the pulling action. A command will be fired and it can be used to refresh (add, delete or modify the underlying data) the grid. To enable the pull to refresh feature, you must set the AllowPullToRefresh to true and also must set the PullToRefreshCommand property. By default, a busy indicator will be displayed when doing the pulling animation. However, SfDataGrid allows you to customize this view based on the requirement using PullToRefreshView property.
Examples
dataGrid.AllowPullToRefresh = true;
dataGrid.PullToRefreshCommand = new Command(ExecutePullToRefreshCommand);
private async void ExecutePullToRefreshCommand()
{
this.dataGrid.IsBusy = true;
await Task.Delay(new TimeSpan(0, 0, 5));
viewModel.ItemsSourceRefresh ();
this.dataGrid.IsBusy = false;
}
See Also
AllowResizingColumn
Gets or sets a value indicating whether to enable the column resizing or not. SfDataGrid allows to resize the columns by tapping and dragging the right border of the column headers, by enabling this property.
Declaration
public bool AllowResizingColumn { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if column resizing is enabled, otherwise false. The default value is false. |
Remarks
By enabling column resizing in SfDataGrid by setting AllowResizingColumn to true, the columns can be resized from MinimumWidth to MaximumWidth.
Examples
dataGrid.AllowResizingColumn = true;
See Also
AllowSorting
Gets or sets a value indicating whether to enable/disable sorting in SfDataGrid. When AllowSorting is set as true, the user can sort the data simply by tapping the column header he wishes to sort. SfDataGrid also allows the user to programmatically sort the column by adding the SortColumnDescription to the SortColumnDescriptions collection.
Declaration
public bool AllowSorting { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if sorting is enabled, otherwise false. The default value is false. |
Remarks
SfDataGrid allows to sort the data by setting the AllowSorting as true. The user can sort the data by just tapping the column header he wishes to sort or programmatically sort the column by adding the SortColumnDescription to the SortColumnDescriptions collection. Once sorting is applied, the SfDataGrid shows a sort icon in the respective column header indicating the direction of sorting.
Examples
dataGrid.AllowSorting = true;
See Also
AllowSwiping
Gets or sets a value indicating whether to enable/disable the swiping in SfDataGrid control. Swipe views are displayed when swiping from ‘left to right’ or ‘right to left’ on a data row when swiping is enabled.
Declaration
public bool AllowSwiping { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True, if swiping is enabled, otherwise false. The default value is false. |
Remarks
When swiping is enabled in SfDataGrid, the swipe view can be displayed when swiping from ‘left to right’ or ‘right to left’ on a data row. SfDataGrid allows the user to customize the swipe views to be displayed by using LeftSwipeTemplate and RightSwipeTemplate. The swipe gesture can be restricted up to a certain point by using MaxSwipeOffset property. This property does not have an effect on WPF platform.
Examples
dataGrid.AllowSwiping = true;
See Also
AllowTriStateSorting
Gets or sets a value indicating whether to enable tri-state sorting or not. By enabling the tri-state sorting in the SfDataGrid, the data can be sorted in three states : ascending, descending and unsorted.
Declaration
public bool AllowTriStateSorting { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if tri-state sorting is enabled, otherwise false. The default value is false. |
Remarks
SfDataGrid also allows you to unsort the data in the original order by clicking the header again after sorting to descending order by setting the AllowTriStateSorting property to true.
Examples
dataGrid.AllowTriStateSorting = true;
See Also
AllowZooming
Gets or sets a value indicating whether to enable/disable pinch zooming in the SfDataGrid control. Runtime changes to this property does not have any effect and is not recommended. Applicable only for the iOS platform.
Declaration
public bool AllowZooming { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false. |
Remarks
Setting true to this property enables pinch zooming in SfDataGrid control. This property is applicable only for the iOS platform.
Examples
dataGrid.AllowZooming = true;
AlternationCount
Gets or sets the alternation count for applying alternate row color to the rows of SfDataGrid.
Declaration
public int AlternationCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The alternation count of the rows for which the alternate row color should be applied. |
Remarks
SfDataGrid allows the user to set alternate row color by setting the AlternatingRowColor property to the applied GridStyle property. SfDataGrid allows you to customize the rows for which the alternate row color needs to be updated based on the AlternationCount property.
Examples
dataGrid.AlternationCount = 3;
dataGrid.GridStyle = new CustomGridStyle();
//CustomGridStyle.cs
public class CustomGridStyle : DataGridStyle
{
public override Color GetAlternatingRowBackgroundColor()
{
return Color.FromRgb(15, 15, 15);
}
}
See Also
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
public bool AutoExpandGroups { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if auto expand groups is enabled, otherwise, false. The default value is true. |
Examples
this.dataGrid.AutoExpandGroups = false;
See Also
AutoGenerateColumns
Gets or sets a value indicating whether to generate the columns automatically or not. The SfDataGrid creates columns automatically based on the property AutoGenerateColumns. It decides columns generation for SfDataGrid based on the AutoGenerateColumnsMode property.
Declaration
public bool AutoGenerateColumns { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if auto generate columns is enabled, otherwise false. The default value is true. |
Remarks
The SfDataGrid creates columns automatically based on the property AutoGenerateColumns. It decides columns generation for SfDataGrid based on the AutoGenerateColumnsMode property. The user can also customize the automatically generated column by using the AutoGeneratingColumn event.
Examples
dataGrid.AutoGenerateColumns = false;
See Also
AutoGenerateColumnsForCustomType
Gets or sets a value indicating whether to generate columns automatically for the custom types in data object. SfDataGrid provides support for generate columns automatically for complex properties, when AutoGenerateColumnsForCustomType is set as true.
Declaration
public bool AutoGenerateColumnsForCustomType { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the custom type properties are automatically generated; otherwise , false. The default value is true. |
Remarks
Setting AutoGenerateColumnsForCustomType to true and AutoGenerateColumnsModeForCustomType to Child, generate columns for inner properties.For example, OrderInfo class has Customer property of type Customer, then column generated like Customer.CustomerID.
Examples
dataGrid.AutoGenerateColumnsForCustomType = true;
AutoGenerateColumnsMode
Gets or sets the AutoGenerateColumnsMode of SfDataGrid control. To generate the columns automatically based on the underlying collection the user must set the AutoGenerateColumns as true. 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 Reset. |
Remarks
When columns are generated automatically by setting SfDataGrid.AutoGenerateColumns = true
, 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
AutoGenerateColumnsMode as None.
Examples
dataGrid.AutoGenerateColumnsMode = AutoGenerateColumnsMode.None;
See Also
AutoGenerateColumnsModeForCustomType
Gets or sets the AutoGenerateColumnsModeForCustomType that indicates whether to create the columns for custom parent type or child inner properties or custom type and its child properties.
Declaration
public AutoGenerateColumnsModeForCustomType AutoGenerateColumnsModeForCustomType { get; set; }
Property Value
Type | Description |
---|---|
AutoGenerateColumnsModeForCustomType | The default is Parent. |
Remarks
By default, the columns are created for custom parent type.
Examples
dataGrid.AutoGenerateColumnsModeForCustomType = AutoGenerateColumnsModeForCustomType.Both;
CanMaintainScrollPosition
Gets or sets a value indicating whether ScrollPosition should be maintained when ItemsSource or SourceCollection for the SfDataGrid is changed.
Declaration
public bool CanMaintainScrollPosition { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if need to maintain scroll position, otherwise, false. The default value is false. |
Examples
dataGrid.CanMaintainScrollPosition = true;
CanUseViewFilter
Gets or sets a value indicating whether to create view by either considering ICollectionView.Filter or DataView.RowFilter.
Declaration
public bool CanUseViewFilter { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if View need to filter the rows in SfDataGrid, using DataView.RowFilter expression or ICollectionView.Filter method; otherwise ,false. The default value is false. |
Remarks
The default filter which created in DataView or ICollectionView can be applied or canceled through CanUseViewFilter property.
CaptionSummaryRow
Gets or sets the caption summary row of the group in the SfDataGrid. Every group as a caption summary row,
which is used to display the summary information in the caption of the group.
Declaration
public GridSummaryRow CaptionSummaryRow { get; set; }
Property Value
Type | Description |
---|---|
GridSummaryRow | The caption summary row of the group in the SfDataGrid. |
Remarks
SfDataGrid provides built-in support for caption summaries. The caption summary value calculated based on the records in a group and the summary information will be displayed in the caption of group.
See Also
CaptionSummaryTemplate
Gets or sets the template that is used to display the contents of a group caption. By default, text will be displayed on group caption . However, when this property is set, SfDataGrid loads the template as the Content of the group caption.
Declaration
public DataTemplate CaptionSummaryTemplate { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.DataTemplate | The template that displays the contents of a group caption. |
Remarks
SfDataGrid allows the user to customize the group caption with different type of views by setting Xamarin.Forms.DataTemplateSelector to the CaptionSummaryTemplate.
Examples
<sfgrid:SfDataGrid>
<sfgrid:SfDataGrid.CaptionSummaryTemplate>
<DataTemplate>
<Label Text = "Template"
HorizontalTextAlignment = "Center"
VerticalTextAlignment = "Center"
/>
</DataTemplate>
</sfgrid:SfDataGrid.CaptionSummaryTemplate>
</sfgrid:SfDataGrid>
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 GridCellTextViewRenderer class, to customize the cell in the GridTextColumn, then he needs to replace it in the CellRenderers collection.
Examples
dataGrid.CellRenderers.Remove("TextView");
dataGrid.CellRenderers.Add("TextView", CustomTextViewRenderer);
//CustomTextViewRenderer.cs
public class CustomTextViewRenderer : GridCellTextViewRenderer
{
}
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
public Columns Columns { get; set; }
Property Value
Type | Description |
---|---|
Columns | 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 GridColumn 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
dataGrid.Columns.Add(new GridTextColumn() { MappingName = "OrderID" });
List<GridColumn> myColumnsCollection = new List<GridColumn>();
myColumnsCollection.Add(new GridTextColumn() { MappingName = "OrderID" });
myColumnsCollection.Add(new GridTextColumn() { MappingName = "EmployeeID" });
myColumnsCollection.Add(new GridTextColumn() { MappingName = "CustomerID" });
dataGrid.Columns = myColumnsCollection;
See Also
ColumnSizer
Gets or sets the ColumnSizer of the SfDataGrid, that specify how columns in the SfDataGrid are sized. SfDataGrid applies width for all the GridColumn in the Columns collection based on the ColumnSizer property.
Declaration
public ColumnSizer ColumnSizer { get; set; }
Property Value
Type | Description |
---|---|
ColumnSizer | The type of ColumnSizer that is applied to the SfDataGrid. The default value is None. |
Remarks
The user can specify how columns in the SfDataGrid are sized. SfDataGrid applies width for all the GridColumn in the Columns collection based on the ColumnSizer property. When the ColumnSizer is Star, all the GridColumn are adjusted an equal column width to fit within the view.
Examples
dataGrid.ColumnSizer = ColumnSizer.Star;
See Also
CurrentCellManager
Gets the CurrentCell manager of the SfDataGrid.
Declaration
public GridCurrentCellManager CurrentCellManager { get; }
Property Value
Type | Description |
---|---|
GridCurrentCellManager | The GridCurrentCellManager of SfDataGrid. |
CurrentItem
Gets or sets the current selected item of the SfDataGrid.
Declaration
public object CurrentItem { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The current selected item of the SfDataGrid. |
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
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. |
Remarks
SfDataGrid supports Incremental loading, by which when the user reaches the end of the collection in the dataGrid, the data will be fetched automatically. The user can customize the size of the data to be fetched by setting the DataFetchSize property.
Examples
dataGrid.DataFetchSize = 10;
DefaultColumnWidth
Gets or sets the default column width of the SfDataGrid. GridColumn 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 60. |
Remarks
SfDataGrid allows you to customize the default column width property based on the requirement by setting the DefaultColumnWidth property. Columns are arranged in view based on the DefaultColumnWidth property when the ColumnSizer is None.
Examples
dataGrid.DefaultColumnWidth = 80;
EditorSelectionBehavior
Gets or sets the editor selection behavior, when a grid cell enters into edit mode. The editor selection behavior indicates the position of cursor and selection in edit element, when entering into edit mode. SfDataGrid provides support for editing the cell values, when AllowEditing is set as true.
Declaration
public EditorSelectionBehavior EditorSelectionBehavior { get; set; }
Property Value
Type | Description |
---|---|
EditorSelectionBehavior | The EditorSelectionBehavior, when SfDataGrid enters into editing mode. The default value is MoveLast. |
Remarks
SfDataGrid provides support for customizing the editor selection behavior when the cell enters into edit mode. SfDataGrid either selects the text of edit element loaded inside cell or places the cursor at the last of edit element loaded inside cell. By default, SfDataGrid places the cursor at the last of the edit element.
Examples
dataGrid.EditorSelectionBehavior = EditorSelectionBehavior.SelectAll;
See Also
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 TapAction EditTapAction { get; set; }
Property Value
Type | Description |
---|---|
TapAction | The tap action selected for entering into editing mode. The default value is OnDoubleTap. |
Remarks
The user can customize the edit tap action by setting the EditTapAction property. SfDataGrid enters into edit mode either by just tapping or double tapping the grid cells.
Examples
this.dataGrid.EditTapAction = TapAction.OnTap;
See Also
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
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;
FrozenColumnsCount
Gets or sets the frozen columns count to freeze the columns at the left, next to the row header column if ShowRowHeader is true.
Declaration
public int FrozenColumnsCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The number of columns to be frozen from left end, next to row header, if ShowRowHeader is true. The default value is 0. |
Remarks
SfDataGrid also provides support to freeze the columns at the left of the view by setting the FrozenColumnsCount property.
Examples
dataGrid.FrozenColumnsCount = 2;
See Also
FrozenRowsCount
Gets or sets the frozen rows count to freeze the rows at the top below header.
Declaration
public int FrozenRowsCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The number of rows to be frozen from top below header. The default value is 0. |
Remarks
SfDataGrid provides extensive support to freeze the rows at the top of the view below the header row by setting the FrozenRowsCount property.
Examples
dataGrid.FrozenRowsCount = 2;
See Also
GridColumnSizer
Gets or sets the GridColumnSizer of the SfDataGrid, which handles the column sizing for all the columns in the Columns collection of SfDataGrid.
Declaration
public GridColumnSizer GridColumnSizer { get; set; }
Property Value
Type | Description |
---|---|
GridColumnSizer | The GridColumnSizer of SfDataGrid. |
GridDoubleTappedCommand
Gets or sets the command to be executed when an end-user Double tapped on the SfDataGrid.
Declaration
public ICommand GridDoubleTappedCommand { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | The command to be executed when Double Tap action is performed on DataGrid. |
Examples
<ContentPage.BindingContext>
<local:ViewModel x:Name="viewModel" />
</ContentPage.BindingContext>
<syncfusion:SfDataGrid x:Name="dataGrid"
GridDoubleTappedCommand="{Binding DoubleTappedCommand}"
</syncfusion:SfDataGrid>
// ViewModel.cs
this.DoubleTappedCommand = new Command(ExecuteGridDoubleTappedCommand);
private async void ExecuteGridDoubleTappedCommand(object e)
{
if(e as GridDoubleTappedEventArgs.RowColumnIndex.RowIndex == 2)
{
// Do the required operations here.
}
}
GridLongPressedCommand
Gets or sets the command to be executed when an end-user long Press on the SfDataGrid.
Declaration
public ICommand GridLongPressedCommand { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | The command to be executed when LongPress action is performed on SfDataGrid. |
Examples
<ContentPage.BindingContext>
<local:ViewModel x:Name="viewModel" />
</ContentPage.BindingContext>
<syncfusion:SfDataGrid x:Name="dataGrid"
GridLongPressedCommand="{Binding LongPressedCommand}"
</syncfusion:SfDataGrid>
// ViewModel.cs
this.LongPressedCommand = new Command(ExecuteGridLongPressedCommand);
private async void ExecuteLongPressedCommand(object e)
{
if(e as GridLongPressedEventArgs.RowColumnIndex.RowIndex == 2)
{
// Do the required operations here.
}
}
GridModel
Gets or sets the GridModel of the SfDataGrid.
Declaration
protected GridModel GridModel { get; set; }
Property Value
Type |
---|
GridModel |
GridStyle
Gets or sets the grid style of the SfDataGrid. The default style will be applied to the SfDataGrid, the user can customize the style applied to the SfDataGrid.
Declaration
public DataGridStyle GridStyle { get; set; }
Property Value
Type | Description |
---|---|
DataGridStyle | The grid style of the SfDataGrid. |
Remarks
SfDataGrid allows to customize the style of SfDataGrid, by implementing the DataGridStyle class and setting the customized grid style class as GridStyle.
Examples
dataGrid.GridStyle = new CustomGridStyle();
//CustomGridStyle.cs
public class CustomGridStyle : DataGridStyle
{
public override Color GetHeaderBackgroundColor()
{
return Color.FromRgb(15, 15, 15);
}
}
See Also
GridTappedCommand
Gets or sets the command to be executed when an end-user taps on the SfDataGrid.
Declaration
public ICommand GridTappedCommand { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | The command to be executed when Tap action is performed on DataGrid. |
Examples
<ContentPage.BindingContext>
<local:ViewModel x:Name="viewModel" />
</ContentPage.BindingContext>
<syncfusion:SfDataGrid x:Name="dataGrid"
GridTappedCommand="{Binding TapCommand}"
</syncfusion:SfDataGrid>
// ViewModel.cs
this.TapCommand = new Command(ExecuteGridTappedCommand);
private async void ExecuteGridTappedCommand(object e)
{
if(e as GridTappedEventArgs.RowColumnIndex.RowIndex == 2)
{
// Do the required operations here.
}
}
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
public string GroupCaptionTextFormat { get; set; }
Property Value
Type | Description |
---|---|
System.String | The group caption text format of the caption summary rows in SfDataGrid. |
Remarks
SfDataGrid supports setting custom GroupCaptionTextFormat for CaptionSummaryRows. By default the group caption text will be in the format "{ColumnName} : {Key} - {ItemsCount} Items". The user can customize this text format by setting the GroupCaptionTextFormat property.
Examples
dataGrid.GroupCaptionTextFormat = "{ColumnName} : {Key} - {ItemsCount} Produkte";
See Also
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
public GroupColumnDescriptions GroupColumnDescriptions { get; set; }
Property Value
Type | Description |
---|---|
GroupColumnDescriptions | The GroupColumnDescriptions collection of SfDataGrid. |
Remarks
SfDataGrid allows grouping by which the records having identical values in the grouped column are combined to form a group. The user can get the columns that represent grouping from the GroupColumnDescriptions collection. SfDataGrid groups the data based on the GroupColumnDescription object that is added to the GroupColumnDescriptions collection. The user must set the ColumnName as the MappingName of the column, he wants to group.
Examples
dataGrid.GroupColumnDescriptions.Add (new GroupColumnDescription ()
{
ColumnName = "CustomerID",
});
See Also
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
public GroupingMode GroupingMode { get; set; }
Property Value
Type | Description |
---|---|
GroupingMode | GroupingMode.Multiple Will allow to group more than one column. GroupingMode.Single will allow to group only one column. |
Examples
dataGrid.GroupingMode = GroupingMode.Multiple;
GroupSummaryRows
Gets or sets the collection of group summary rows of the SfDataGrid. The group summary value is calculated based on the grouped records in SfDataGrid. SfDataGrid allows you to add multiple group summary.
Declaration
public ObservableCollection<GridGroupSummaryRow> GroupSummaryRows { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<GridGroupSummaryRow> | The collection of GridGroupSummaryRow of SfDataGrid. |
Remarks
SfDataGrid provides built-in support for group summaries. Group Summary is used to display the summary information. The user can add group summary row in SfDataGrid by adding GridGroupSummaryRow to the GroupSummaryRows collection.
Examples
GridGroupSummaryRow summaryRow = new GridGroupSummaryRow();
summaryRow.SummaryColumns.Add(new GridSummaryColumn()
{
Name = "Salary",
MappingName = "Salary",
Format = "{Sum}",
SummaryType = SummaryType.DoubleAggregate
});
sfGrid.GroupSummaryRows.Add(summaryRow);
GroupSummaryTemplate
Gets or sets the template that is used to display the contents of a group summary. By default, text will be displayed on group summary . However, when this property is set, SfDataGrid loads the template as the content of the group summary.
Declaration
public DataTemplate GroupSummaryTemplate { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.DataTemplate | The template that displays the contents of a group summary. |
Remarks
SfDataGrid allows the user to customize the group summary with different type of views by setting Xamarin.Forms.DataTemplateSelector to the GroupSummaryTemplate.
Examples
<sfgrid:SfDataGrid>
<sfgrid:SfDataGrid.GroupSummaryTemplate>
<DataTemplate>
<Label Text = "Template"
HorizontalTextAlignment = "Center"
VerticalTextAlignment = "Center"
/>
</DataTemplate>
</sfgrid:SfDataGrid.GroupSummaryTemplate>
</sfgrid:SfDataGrid>
HeaderRowHeight
Gets or sets the row height of the header in SfDataGrid.
Declaration
public double HeaderRowHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The height of the header row. The default value is 40. |
Remarks
SfDataGrid allows you to customize the height of the header row by setting the HeaderRowHeight property. The user can collapse the header row by setting HeaderRowHeight to zero.
Examples
dataGrid.HeaderRowHeight = 100;
See Also
HorizontalScrollBarVisibility
Gets or sets a value indicating whether to display the horizontal scrollbar or not. Applicable only when datagrid has horizontally scrollable content.
Declaration
public bool HorizontalScrollBarVisibility { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if horizontal scroll bar is visible, otherwise, false. The default value is true. |
Examples
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:GettingStarted"
xmlns:sfgrid="clr-namespace:Syncfusion.SfDataGrid.XForms;assembly=Syncfusion.SfDataGrid.XForms"
x:Class="GettingStarted.DataGridPage">
<ContentPage.BindingContext>
<local:ViewModel/>
</ContentPage.BindingContext>
<StackLayout Orientation="Vertical">
<sfgrid:SfDataGrid x:Name="sfGrid"
HorizontalScrollBarVisibility="False"
ItemsSource="{Binding OrdersInfo}">
</sfgrid:SfDataGrid>
</StackLayout>
</ContentPage>
sfGrid.HorizontalScrollBarVisibility = false;
ImeOptions
Gets or sets the Input Method Editor (IME) options of the editor views in the SfDataGrid in Android platform.
Declaration
public GridImeOptions ImeOptions { get; set; }
Property Value
Type |
---|
GridImeOptions |
Remarks
This is applicable only for Android and the default value is ImeOptions.Done.
IndentColumnWidth
Gets or sets the width of the indent column. as true.
Declaration
public double IndentColumnWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The width of the indent column. The default value is 20. |
Remarks
SfDataGrid allows you to customize the width of the indent column based on the requirement by setting the IndentColumnWidth.
Examples
dataGrid.IndentColumnWidth = 35;
IsBusy
Gets or sets a value indicating whether the busy state of the SfDataGrid while executing the LoadMoreCommand or PullToRefreshCommand.
Declaration
public bool IsBusy { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if SfDataGrid is executing either the LoadMoreCommand or PullToRefreshCommand, otherwise false. By default the value is false. |
Remarks
SfDataGrid will be busy when the underlying collection is refreshed or modified by executing the LoadMoreCommand or PullToRefreshCommand.
ItemsSource
Gets or sets a value indicating whether the external data source of 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
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 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.
Examples
viewModel = new OrdersInfoViewModel();
dataGrid.ItemsSource = viewModel.OrderInfoCollection;
See Also
LeftSwipeTemplate
Gets or sets the left swipe template to be displayed when swiping from 'left to right'. SfDataGrid enables you to load a desired Content to be displayed when swiping towards right using this property. The swipe views will be displayed only when AllowSwiping is set as true.
Declaration
public DataTemplate LeftSwipeTemplate { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.DataTemplate | The template that is displayed when left swipe action is performed. |
Remarks
When swiping is enabled in SfDataGrid, the swipe view can be displayed when swiping from ‘left to right’ or ‘right to left’ on a data row. SfDataGrid allows the user to customize the swipe views to be displayed by using LeftSwipeTemplate and RightSwipeTemplate. The swipe gesture can be restricted up to a certain point by using MaxSwipeOffset property. The contents inside the swipe template are arranged based on the offset values when you swipe a data row. This property does not have an effect on WPF platform.
Examples
dataGrid.LeftSwipeTemplate = new DataTemplate(() =>
{
return new Label(){BackgroundColor = Color.Red, Text="Left"};
});
See Also
LiveDataUpdateMode
Gets or sets a value to control data manipulation operations during data updates.
Declaration
public LiveDataUpdateMode LiveDataUpdateMode { get; set; }
Property Value
Type | Description |
---|---|
LiveDataUpdateMode | Indicates how data manipulation operations are handled during data updates. The default value is Default. |
LoadMoreCommand
Gets or sets the command to be executed when an end-user taps the LoadMoreView to load new data items in SfDataGrid.
Declaration
public ICommand LoadMoreCommand { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | The command to be executed when load more view is clicked. |
Remarks
SfDataGrid allows to load more items in the SfDataGrid, when the last data of the collection is reached, by executing the LoadMoreCommand when an end-user taps the LoadMoreView of SfDataGrid.
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;
}
See Also
LoadMorePosition
Gets or sets the position to load the LoadMoreView in SfDataGrid control. When the grid is scrolled to the last record of the collection, a view will be displayed which provides an option to load more items when the LoadMoreView is tapped. The user can customize the position of the LoadMoreView either to appear in the bottom or top below the header using this property. To enable the load more option, it is mandatory to set AllowLoadMore as true.
Declaration
public LoadMoreViewPosition LoadMorePosition { get; set; }
Property Value
Type | Description |
---|---|
LoadMoreViewPosition | The LoadMoreViewPosition to display the LoadMoreView in SfDataGrid. The default value is Bottom. |
Remarks
SfDataGrid allows the user to customize the position of the LoadMoreView. By default, the load more view will be positioned at the bottom of SfDataGrid. The user can customize the load more view to appear in the top below the header by setting LoadMorePosition as Top.
Examples
dataGrid.LoadMorePosition = LoadMoreViewPosition.Top;
See Also
LoadMoreText
Gets or sets the load more text to be displayed in the LoadMoreView. By default, the LoadMoreView displays the "LOAD MORE ITEMS" text, the user can customize the text to be displayed in the LoadMoreView by using this property.
Declaration
public string LoadMoreText { get; set; }
Property Value
Type | Description |
---|---|
System.String | The text to be displayed in LoadMoreView. By default, the value is "LOAD MORE ITEMS". |
Examples
dataGrid.LoadMoreText = "Click here to Load More Items";
See Also
LoadMoreView
Gets or sets the LoadMoreView of the SfDataGrid, which will be displayed when the grid is scrolled to the last position of SfDataGrid, provided that AllowLoadMore is set as true.
Declaration
public LoadMoreView LoadMoreView { get; set; }
Property Value
Type | Description |
---|---|
LoadMoreView | The LoadMoreView of SfDataGrid. |
Remarks
SfDataGrid provides an option to load more items in runtime, when the grid is scrolled to the last record of the collection. A command will be fired when the LoadMoreView is tapped and it can be used to add more items to the underlying data. To enable the load more feature, you must set the AllowLoadMore to true and also must set the LoadMoreCommand property.
By default, load more view is a button, containing the text "LOAD MORE ITEMS". SfDataGrid allows to customize the load more view, by implementing the LoadMoreView class and setting the customized load more view class to LoadMoreView.
Examples
dataGrid.LoadMoreView = new CustomLoadMoreView();
//CustomLoadMoreView.cs
public class CustomLoadMoreView : LoadMoreView
{
}
See Also
LostFocusBehavior
Gets or sets a value that specifies the behavior of the DataGrid when it loses focus. This property is applicable only for GridTextColumn and GridNumericColumn.
Declaration
public LostFocusBehavior LostFocusBehavior { get; set; }
Property Value
Type | Description |
---|---|
LostFocusBehavior | The default value is Default. |
Remarks
This property is applicable only for GridTextColumn and GridNumericColumn.
MaximumZoomScale
Gets or sets a value that indicates the maximum permitted scale factor that can be applied to the SfDataGrid control.
Declaration
public float MaximumZoomScale { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The default value is 10. |
Remarks
This value should be greater than the value of MinimumZoomScale. If this and MinimumZoomScale are set the same values, zooming will not appear to work, as the zoom will be constrained to that single value.
Examples
dataGrid.MaximumZoomScale = 2;
MaxSwipeOffset
Gets or sets the maximum swipe offset of SfDataGrid control. SfDataGrid enables the swiping option by setting the AllowSwiping to true. Swipe views are displayed when swiping from ‘left to right’ or ‘right to left’ on a data row. The swipe gesture can be restricted up to a certain point by using this property.
Declaration
public double MaxSwipeOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The maximum swipe offset of SfDataGrid. The default value is 200. |
Remarks
This property does not have an effect on WPF platform.
Examples
dataGrid.MaximumSwipeOffset = 300;
See Also
MinimumZoomScale
Gets or sets a value that indicates the minimum permitted scale factor that can be applied to the SfDataGrid control.
Declaration
public float MinimumZoomScale { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The default value is 1. |
Remarks
This value should be smaller than the value of MaximumZoomScale. If this and MaximumZoomScale are set the same values, zooming will not appear to work, as the zoom will be constrained to that single value.
Examples
dataGrid.MinimumZoomScale = 0.5;
NavigationMode
Gets or sets the that indicates whether the arrow key navigation in the SfDataGrid should be cell wise or row wise.
Declaration
public NavigationMode NavigationMode { get; set; }
Property Value
Type | Description |
---|---|
NavigationMode | One of the NavigationMode enumeration that specifies the navigation based on either row or cell in SfDataGrid . The default registered mode is Cell. |
NotificationSubscriptionMode
Gets or sets the NotificationSubscriptionMode of SfDataGrid. By default, SfDataGrid gets the notification for collection and property change of the underlying data. The user can customize the SfDataGrid to get notifications from underlying data for either collection change or property change or both or none of them by using this property.
Declaration
public NotificationSubscriptionMode NotificationSubscriptionMode { get; set; }
Property Value
Type | Description |
---|---|
NotificationSubscriptionMode | The NotificationSubscriptionMode of SfDataGrid. The default value is CollectionChange and PropertyChange. |
Examples
dataGrid.NotificationSubscriptionMode = NotificationSubscriptionMode.PropertyChange;
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
public ICommand PullToRefreshCommand { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | The command to be executed when PullToRefresh action is performed. |
Remarks
SfDataGrid provides an option to refresh it when performing the pulling action. PullToRefreshCommand will be fired to refresh (add, delete or modify the underlying data) the grid. A busy indicator will be displayed to denote the pulling and refreshing operation.
Examples
dataGrid.AllowPullToRefresh = true;
dataGrid.PullToRefreshCommand = new Command(ExecutePullToRefreshCommand);
private async void ExecutePullToRefreshCommand()
{
this.dataGrid.IsBusy = true;
await Task.Delay(new TimeSpan(0, 0, 5));
viewModel.ItemsSourceRefresh ();
this.dataGrid.IsBusy = false;
}
See Also
PullToRefreshView
Gets or sets the view to indicate the Progress of pulling operation in a SfDataGrid. Any view that can indicate the Progress of the pulling can be assigned to the property such that it animates the values of the Progress of pulling.
Declaration
public PullToRefreshView PullToRefreshView { get; set; }
Property Value
Type | Description |
---|---|
PullToRefreshView | The view that is displayed when pull to refresh is done. |
Remarks
SfDataGrid provides you an option to refresh it when performing the pulling action. A command will be fired when pulling action is performed and it can be used to refresh (add, delete or modify the underlying data) in the grid. To enable the pull to refresh feature, you must set the AllowPullToRefresh to true and also must set the command to PullToRefreshCommand property. By default, a busy indicator will be displayed when doing the pulling action. However, SfDataGrid allows you to customize this view based on the requirement using PullToRefreshView property.
Examples
dataGrid.PullToRefreshView = new CustomPullToRefreshView();
// CustomPullToRefreshView.cs
public class CustomPullToRefreshView : PullToRefreshView
{
}
ResizingMode
Gets or sets a value indicating the ResizingMode for the resizing operation in a SfDataGrid control. Columns in SfDataGrid can be resized either on touch-up or on-move.
Declaration
public ResizingMode ResizingMode { get; set; }
Property Value
Type | Description |
---|---|
ResizingMode | The ResizingMode of SfDataGrid. The default value is OnMoved. |
Remarks
SfDataGrid allows two modes of resizing, which can be set using this property. The available resizing modes are: OnMoved and OnTouchUp.
Examples
dataGrid.ResizingMode = ResizingMode.OnTouchUp;
See Also
ReuseRowsOnItemsSourceChange
Gets or sets a value indicating whether to re-generate the rows or re-use the existing rows when ItemsSource is changed at run time.
Declaration
public bool ReuseRowsOnItemsSourceChange { get; set; }
Property Value
Type |
---|
System.Boolean |
Examples
dataGrid.ReuseRowsOnItemsSourceChange = false;
RightSwipeTemplate
Gets or sets the left swipe template to be displayed when swiping from 'right to left'. SfDataGrid enables you to load a desired Content to be displayed when swiping towards left using this property. The swipe views will be displayed only when AllowSwiping is set as true.
Declaration
public DataTemplate RightSwipeTemplate { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.DataTemplate | The template that is displayed when right swipe action is performed. |
Remarks
When swiping is enabled in SfDataGrid, the swipe view can be displayed when swiping from ‘left to right’ or ‘right to left’ on a data row. SfDataGrid allows the user to customize the swipe views to be displayed by using LeftSwipeTemplate and RightSwipeTemplate. The swipe gesture can be restricted up to a certain point by using MaxSwipeOffset property. The contents inside the swipe template are arranged based on the offset values when you swipe a data row. This property does not have an effect on WPF platform.
Examples
dataGrid.RightSwipeTemplate = new DataTemplate(() =>
{
return new Label(){BackgroundColor = Color.Blue, Text="Right"};
});
See Also
RowDragDropTemplate
Gets or sets the template to be displayed when row drag and drop action is performed. SfDataGrid allows the user to load a desired Content when performing row drag and drop operation using this property. To enable row drag and drop, it is mandatory to set AllowDraggingRow to true.
Declaration
public DataTemplate RowDragDropTemplate { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.DataTemplate | The template that is displayed when row drag and drop action is done. |
Remarks
SfDataGrid allows you to drag and drop a row by setting the AllowDraggingRow property to true. A customizable row drag and drop template is displayed while dragging a row. The default template will be displayed, if row drag and drop template is empty. The drag and drop operation can be handled based on the requirement using QueryRowDragging event.
Examples
dataGrid.RowDragDropTemplate = new DataTemplate(() => { return new RowTemplate(); });
//RowTemplate.cs
public class RowTemplate : Grid
{
}
See Also
RowGenerator
Gets or sets the RowGenerator.
Declaration
protected RowGenerator RowGenerator { get; set; }
Property Value
Type |
---|
RowGenerator |
RowHeaderTemplate
Gets or sets the template that is used to display the contents of a row header. By default, nothing will be displayed in the row header. However, when this property is set, SfDataGrid loads the template as the Content of the row header cells.
Declaration
public DataTemplate RowHeaderTemplate { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.DataTemplate | The template that displays the contents of a RowHeader. |
Remarks
To include the RowHeader column to SfDataGrid, you need to set the ShowRowHeader to true.
Initially when you set the SfDataGrid.ShowRowHeader = true
, you will be able to see empty cells in front of the rows.
SfDataGrid enables the user to set the Content and the view to be loaded in the RowHeader by using
RowHeaderTemplate property.
Examples
<ContentPage.BindingContext>
<local:ViewModel x:Name="viewModel" />
</ContentPage.BindingContext>
<sfgrid:SfDataGrid ShowRowHeader="True">
<sfgrid:SfDataGrid.RowHeaderTemplate>
<DataTemplate>
<Label Text = "{Binding Index}"
HorizontalTextAlignment = "Center"
VerticalTextAlignment = "Center"
/>
</DataTemplate>
</sfgrid:SfDataGrid.RowHeaderTemplate>
</sfgrid:SfDataGrid>
See Also
RowHeaderWidth
Gets or sets the width of the row header column which will be frozen at the left end of the view. To include the row header column, the user needs to set ShowRowHeader as true.
Declaration
public double RowHeaderWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The width of the row header column. The default value is 20. |
Remarks
SfDataGrid allows you to customize the width of the row header column based on the requirement by setting the RowHeaderWidth.
Examples
dataGrid.ShowRowHeader = true;
dataGrid.RowHeaderWidth = 35;
RowHeight
Gets or sets the height of the rows in the body and footer region of SfDataGrid.
Declaration
public double RowHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The height of the rows in the body and footer region of SfDataGrid. The default value is 50. |
Remarks
SfDataGrid allows you to customize the height of the grid rows in the body and footer region by setting the RowHeight property. This property responds to runtime changes and hence you can customize it based on your requirement.
Examples
dataGrid.RowHeight = 80;
See Also
ScrollingMode
Gets or sets the ScrollingMode of the SfDataGrid. By default, SfDataGrid scrolls based on the pixel values. The user can customize the scrolling mode of the SfDataGrid by using the ScrollingMode property.
Declaration
public ScrollingMode ScrollingMode { get; set; }
Property Value
Type | Description |
---|---|
ScrollingMode | The ScrollingMode of the SfDataGrid. The default value is Pixel. |
Remarks
SfDataGrid allows to customize the scrolling mode of SfDataGrid using the ScrollingMode property. SfDataGrid provides three types of scrolling mode : Line, PixelLine and Pixel.
Examples
dataGrid.ScrollingMode = ScrollingMode.PixelLine;
See Also
SelectedIndex
Gets or sets the selected row's index in the SfDataGrid. To enable Selection in SfDataGrid, you need to set the SelectionMode property to value other than None.
Declaration
public int SelectedIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The index of the selected row in the SfDataGrid. |
Remarks
SfDataGrid lets you to select a specific row either programmatically or by touch interactions. Selection can also be done programmatically by setting the row index to be selected to the SelectedIndex property.
Examples
dataGrid.SelectedIndex = 3;
See Also
SelectedItem
Gets or sets the selected item of the SfDataGrid. To enable Selection in SfDataGrid, you need to set the SelectionMode property to value other than None.
Declaration
public object SelectedItem { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The selected item of the SfDataGrid. |
Remarks
SfDataGrid lets you to select a specific row either programmatically or by touch interactions. Selection can also be done programmatically by setting the underlying object to be selected to the SelectedItem property.
Examples
dataGrid.SelectedItem = viewModel.OrdersInfo[5];
See Also
SelectedItems
Gets or sets the selected items collection of the SfDataGrid. To enable multiple Selection in SfDataGrid, you need to set the SelectionMode property to Multiple.
Declaration
public ObservableCollection<object> SelectedItems { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<System.Object> | The selected items collection of the SfDataGrid. |
Remarks
SfDataGrid lets you to select a specific row or group of rows either programmatically or by touch interactions. When the selection mode is Multiple the user can programmatically select more than one row by adding the underlying object to be selected to the SelectedItems property.
Examples
dataGrid.SelectedItems.Add (viewModel.OrdersInfo [4]);
dataGrid.SelectedItems.Add (viewModel.OrdersInfo [5]);
See Also
SelectionController
Gets or sets the GridSelectionController of the SfDataGrid. The GridSelectionController handles the selection operations of SfDataGrid.
Declaration
public GridSelectionControllerBase SelectionController { get; set; }
Property Value
Type | Description |
---|---|
GridSelectionControllerBase | The selection controller of the SfDataGrid. |
Remarks
The GridSelectionController contains methods that handle selection feature of SfDataGrid. The user can customize the GridSelectionController by implementing the GridSelectionController class and by setting the customized selection controller class to the SelectionController. SfDataGrid provides extensibility to have multiple selection colors and to animate the selected rows by extending the GridSelectionController class.
Examples
sfGrid.SelectionController = new CustomSelectionController(sfGrid);
//CustomSelectionController.cs
public class CustomSelectionController : GridSelectionController
{
}
See Also
SelectionMode
Gets or sets the SelectionMode of the SfDataGrid. To enable Selection in SfDataGrid, you need to set the SelectionMode property to value other than None.
Declaration
public SelectionMode SelectionMode { get; set; }
Property Value
Type | Description |
---|---|
SelectionMode | The SelectionMode of the SfDataGrid. The default value is None. |
Remarks
SfDataGrid lets you to select a specific row or group of rows either programmatically or by touch interactions. SfDataGrid allows to control the selection mode by using the SelectionMode property. SfDataGrid supports different selection modes : Single, Multiple, NoneNone and SingleDeselect.
Examples
dataGrid.SelectionMode = SelectionMode.Multiple;
See Also
SelectionUnit
Gets or sets a value that indicates whether the rows, the cells or both the rows and cells are selectable in SfDataGrid.
Declaration
public SelectionUnit SelectionUnit { get; set; }
Property Value
Type | Description |
---|---|
SelectionUnit | The default value is Row. |
ShowColumnWhenGrouped
Gets or sets a value indicating whether the column is displayed on SfDataGrid after it is grouped.
Declaration
public bool ShowColumnWhenGrouped { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the column is displayed in SfDataGrid ; 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, SfDataGrid loads the given template as the Content of the row header cells.
Declaration
public bool ShowRowHeader { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if row header is visible, otherwise false. The default value is false. |
Remarks
To include the RowHeader column to SfDataGrid, you need to set the ShowRowHeader to true.
Initially when you set the SfDataGrid.ShowRowHeader = true
, you will be able to see empty cells in front of the rows.
SfDataGrid enables the user to set the Content and the view to be loaded in the RowHeader by using
RowHeaderTemplate property.
Examples
dataGrid.ShowRowHeader = true;
See Also
SortColumnDescriptions
Gets or sets the collection of SortColumnDescription of SfDataGrid. The user can get the columns that represent sorting from the SortColumnDescriptions collection. SfDataGrid also allows the user to programmatically sort the column by adding the SortColumnDescription to the SortColumnDescriptions collection. The user must set the AllowSorting as true for enabling interactive sorting in a SfDataGrid.
Declaration
public SortColumnDescriptions SortColumnDescriptions { get; set; }
Property Value
Type | Description |
---|---|
SortColumnDescriptions | The collection of columns which represent sorting. |
Remarks
The user can get the columns that represent sorting from the SortColumnDescriptions collection. SfDataGrid also allows the user to programmatically sort the column by adding the SortColumnDescription to the SortColumnDescriptions collection. The user must specify the column to be sorted in the ColumnName which represents the MappingName of the column and the user can optionally set the direction of sorting to be applied by setting the SortDirection. By default columns will be sorted in the ascending order.
Examples
dataGrid.AllowSorting = true;
dataGrid.SortColumnDescriptions.Add (new SortColumnDescription()
{
ColumnName = "OrderID",
SortDirection = ListSortDirection.Descending
});
See Also
SortComparers
Gets the SortComparers of SfDataGrid, for applying sorting to the columns based on the custom logic. SfDataGrid allows you to sort columns based on custom logic when the standard sorting techniques do not meet the requirements. For each column, you can apply different sorting criteria by adding SortComparer objects to SortComparers collection.
Declaration
public SortComparers SortComparers { get; }
Property Value
Type | Description |
---|---|
SortComparers | The SortComparers of SfDataGrid. |
Remarks
SfDataGrid allows you to sort columns based on custom logic when the standard sorting techniques do not meet the requirements. For each column, you can apply different sorting criteria by adding SortComparer objects to SortComparers collection. The SortComparer has the two properties : PropertyName which refers to MappingName of the column to apply sorting. and Comparer which refers to the custom sort comparer that implements the System.Collections.IComparer and ISortDirection interfaces.
Examples
dataGrid.SortComparers.Add (new SortComparer ()
{
PropertyName = "FirstName",
Comparer = new CustomComparer()
});
dataGrid.SortColumnDescriptions.Add (new SortColumnDescription()
{
ColumnName = "FirstName",
SortDirection = ListSortDirection.Descending
});
//CustomComparer.cs
public class CustomComparer : IComparer<Object>, ISortDirection
{
}
See Also
SortTapAction
Gets or sets a value indicating whether to sort the data on single tap or double tap action.
Declaration
public SortTapAction SortTapAction { get; set; }
Property Value
Type | Description |
---|---|
SortTapAction | The value indicating the sort tap action. The default value is SingleTap. |
Remarks
SfDataGrid allows to customize the SortTapAction by which the user can apply sorting either in single tap or double tap action.
Examples
dataGrid.SortTapAction = SortTapAction.DoubleTap;
See Also
SourceType
Gets or sets the SourceType of the ItemsSource.
Declaration
public Type SourceType { get; set; }
Property Value
Type | Description |
---|---|
System.Type | The type of the data source of SfDataGrid. |
Remarks
The user can specify the type of ItemsSource in the SourceType property. The user may get the System.InvalidCastException sometimes when binding with complex data collections which can easily be handled by simply specifying the type of ItemsSource in the SourceType as given in the code example.
Examples
dataGrid.SourceType = typeof(OrderInfo);
Exceptions
Type | Condition |
---|---|
System.InvalidCastException | Sometimes you may get this exception, if you get this exception, you need to set this property as given in the code example. |
StackedHeaderRows
Gets or sets the collection of StackedHeaderRow to add additional headers to group and display the column headers.
Declaration
public StackedHeaderRowCollection StackedHeaderRows { get; set; }
Property Value
Type | Description |
---|---|
StackedHeaderRowCollection | The collection of StackedHeaderRow. The default value is Empty. |
SummaryCalculationMode
Gets or sets a value that denotes the mode of calculation for caption and group summaries for improved performance.
Declaration
public CalculationMode SummaryCalculationMode { get; set; }
Property Value
Type | Description |
---|---|
CalculationMode | One of the CalculationMode that indicates when to perform the summary calculation. The default value isDefault. |
SwipeOffsetMode
Declaration
public SwipeOffsetMode SwipeOffsetMode { get; set; }
Property Value
Type |
---|
SwipeOffsetMode |
TableSummaryRows
Gets or sets the collection of table summary rows 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<GridTableSummaryRow> TableSummaryRows { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<GridTableSummaryRow> | The collection of GridTableSummaryRow of SfDataGrid. |
Remarks
SfDataGrid provides built-in support for table summaries. Table Summary is used to display the summary information at top and/or bottom in SfDataGrid. The user can add table summary row in SfDataGrid by adding GridTableSummaryRow to the TableSummaryRows collection.
Examples
GridTableSummaryRow summaryRow = new GridTableSummaryRow();
summaryRow.SummaryColumns.Add(new GridSummaryColumn()
{
Name = "TotalSalary",
MappingName = "Salary",
Format = "{Sum}",
SummaryType = SummaryType.DoubleAggregate
});
sfGrid.TableSummaryRows.Add(summaryRow);
See Also
TableSummaryTemplate
Gets or sets the template that is used to display the contents of a table summary. However, when this property is set, SfDataGrid loads the template as the Content of the table summary.
Declaration
public DataTemplate TableSummaryTemplate { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.DataTemplate | The template that displays the contents of a table summary. |
Examples
<sfgrid:SfDataGrid>
<sfgrid:SfDataGrid.TableSummaryTemplate>
<DataTemplate>
<Label Text = "Template"
HorizontalTextAlignment = "Center"
VerticalTextAlignment = "Center"
/>
</DataTemplate>
</sfgrid:SfDataGrid.TableSummaryTemplate>
</sfgrid:SfDataGrid>
UnboundRowCellRenderers
Gets the reference to the GridCellRendererCollection instance which holds the renderer's for UnboundRow Cell.
Declaration
public GridCellRendererCollection UnboundRowCellRenderers { get; }
Property Value
Type |
---|
GridCellRendererCollection |
UnboundRows
Gets or sets the collection of UnboundRows rows of the SfDataGrid.
Declaration
public UnboundRows UnboundRows { get; set; }
Property Value
Type |
---|
UnboundRows |
VerticalOverScrollMode
Gets or sets a value indicating what effect to be applied when SfDataGrid is vertically over scrolled. SfDataGrid enables either to provide a bounce effect or no effect when SfDataGrid is vertically over-scrolled.
Declaration
public VerticalOverScrollMode VerticalOverScrollMode { get; set; }
Property Value
Type | Description |
---|---|
VerticalOverScrollMode | The VerticalOverScrollMode of SfDataGrid. By default, Bounce effect is applied. |
Remarks
Note that the VerticalOverScrollMode has no effect in Windows platforms since it does not support bounce effects.
Examples
dataGrid.VerticalOverScrollMode = VerticalOverScrollMode.None;
See Also
VerticalScrollBarVisibility
Gets or sets a value indicating whether to display the vertical scrollbar or not. Applicable only when datagrid has vertically scrollable content.
Declaration
public bool VerticalScrollBarVisibility { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if vertical scroll bar is visible, otherwise, false. The default value is true. |
Examples
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:GettingStarted"
xmlns:sfgrid="clr-namespace:Syncfusion.SfDataGrid.XForms;assembly=Syncfusion.SfDataGrid.XForms"
x:Class="GettingStarted.DataGridPage">
<ContentPage.BindingContext>
<local:ViewModel/>
</ContentPage.BindingContext>
<StackLayout Orientation="Vertical">
<sfgrid:SfDataGrid x:Name="sfGrid"
VerticalScrollBarVisibility="False"
ItemsSource="{Binding OrdersInfo}">
</sfgrid:SfDataGrid>
</StackLayout>
</ContentPage>
sfGrid.VerticalScrollBarVisibility = false;
View
Gets the current view of the SfDataGrid. SfDataGrid has the View property of type ICollectionViewAdv interface that implements Syncfusion.Data.ICollectionView interface. View is responsible for maintaining and manipulating data and other advanced operations like Sorting, Grouping, and etc.
Declaration
public ICollectionViewAdv View { get; }
Property Value
Type | Description |
---|---|
ICollectionViewAdv | The collection view of the SfDataGrid. |
Remarks
SfDataGrid has the View property of type ICollectionViewAdv interface that implements Syncfusion.Data.ICollectionView interface. When you bind collection to ItemsSource property, the View will be created and maintains the operations on data such as grouping, sorting, insert, delete, and modification.
See Also
Methods
add_AutoGeneratingColumn(AutoGeneratingColumnEventHandler)
Declaration
public void add_AutoGeneratingColumn(AutoGeneratingColumnEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
AutoGeneratingColumnEventHandler | value |
add_ColumnResizing(GridResizingEventHandler)
Declaration
public void add_ColumnResizing(GridResizingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridResizingEventHandler | value |
add_CurrentCellBeginEdit(GridCurrentCellBeginEditEventHandler)
Declaration
public void add_CurrentCellBeginEdit(GridCurrentCellBeginEditEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridCurrentCellBeginEditEventHandler | value |
add_CurrentCellEndEdit(GridCurrentCellEndEditEventHandler)
Declaration
public void add_CurrentCellEndEdit(GridCurrentCellEndEditEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridCurrentCellEndEditEventHandler | value |
add_GridDoubleTapped(GridDoubleTappedEventHandler)
Declaration
public void add_GridDoubleTapped(GridDoubleTappedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridDoubleTappedEventHandler | value |
add_GridLoaded(GridLoadedEventHandler)
Declaration
public void add_GridLoaded(GridLoadedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridLoadedEventHandler | value |
add_GridLongPressed(GridLongPressedEventHandler)
Declaration
public void add_GridLongPressed(GridLongPressedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridLongPressedEventHandler | value |
add_GridTapped(GridTappedEventHandler)
Declaration
public void add_GridTapped(GridTappedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridTappedEventHandler | value |
add_GridViewCreated(GridViewCreatedEventHandler)
Declaration
public void add_GridViewCreated(GridViewCreatedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridViewCreatedEventHandler | value |
add_GroupCollapsed(GroupChangedEventHandler)
Declaration
public void add_GroupCollapsed(GroupChangedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GroupChangedEventHandler | value |
add_GroupCollapsing(GroupChangingEventHandler)
Declaration
public void add_GroupCollapsing(GroupChangingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GroupChangingEventHandler | value |
add_GroupExpanded(GroupChangedEventHandler)
Declaration
public void add_GroupExpanded(GroupChangedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GroupChangedEventHandler | value |
add_GroupExpanding(GroupChangingEventHandler)
Declaration
public void add_GroupExpanding(GroupChangingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GroupChangingEventHandler | value |
add_QueryColumnDragging(QueryColumnDraggingEventHandler)
Declaration
public void add_QueryColumnDragging(QueryColumnDraggingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
QueryColumnDraggingEventHandler | value |
add_QueryRowDragging(QueryRowDraggingEventHandler)
Declaration
public void add_QueryRowDragging(QueryRowDraggingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
QueryRowDraggingEventHandler | value |
add_QueryRowHeight(QueryRowHeightEventHandler)
Declaration
public void add_QueryRowHeight(QueryRowHeightEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
QueryRowHeightEventHandler | value |
add_QueryUnboundColumnValue(QueryUnboundColumnValueHandler)
Declaration
public void add_QueryUnboundColumnValue(QueryUnboundColumnValueHandler value)
Parameters
Type | Name | Description |
---|---|---|
QueryUnboundColumnValueHandler | value |
add_SelectionChanged(GridSelectionChangedEventHandler)
Declaration
public void add_SelectionChanged(GridSelectionChangedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridSelectionChangedEventHandler | value |
add_SelectionChanging(GridSelectionChangingEventHandler)
Declaration
public void add_SelectionChanging(GridSelectionChangingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridSelectionChangingEventHandler | value |
add_SortColumnsChanged(DataGridSortColumnsChangedEventHandler)
Declaration
public void add_SortColumnsChanged(DataGridSortColumnsChangedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
DataGridSortColumnsChangedEventHandler | value |
add_SortColumnsChanging(DataGridSortColumnsChangingEventHandler)
Declaration
public void add_SortColumnsChanging(DataGridSortColumnsChangingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
DataGridSortColumnsChangingEventHandler | value |
add_SwipeEnded(SwipeEndedEventHandler)
Declaration
public void add_SwipeEnded(SwipeEndedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SwipeEndedEventHandler | value |
add_SwipeStarted(SwipeStartedEventHandler)
Declaration
public void add_SwipeStarted(SwipeStartedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SwipeStartedEventHandler | value |
add_Swiping(SwipingEventHandler)
Declaration
public void add_Swiping(SwipingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SwipingEventHandler | value |
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.
See Also
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.
See Also
ClearSelection()
Clears the selection in a SfDataGrid control.
Declaration
public void ClearSelection()
CollapseAllGroup()
Collapses all the groups in SfDataGrid.
Declaration
public void CollapseAllGroup()
Remarks
This method collapses all the groups in SfDataGrid programmatically.
See Also
CollapseGroup(Group)
Collapses the specified group in SfDataGrid.
Declaration
public void CollapseGroup(Group group)
Parameters
Type | Name | Description |
---|---|---|
Group | group | Specifies the group to collapse it from view. |
Examples
var group = (dataGrid.View.Groups[0] as Group);
this.dataGrid.CollapseGroup(group);
See Also
CollapseGroupsAtLevel(Int32)
Collapses the group based on its level.
Declaration
public void CollapseGroupsAtLevel(int groupLevel)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | groupLevel | Specifies the group level to collapse the group. |
Examples
this.dataGrid.CollapseGroupsAtLevel(2);
Dispose()
Perform final clean up before it is released from memory.
Declaration
public void Dispose()
Dispose(Boolean)
Releases the unmanaged resources used by the component and optionally releases the managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | if true - release both managed and unmanaged resources; if false - release only unmanaged resources. |
EndEdit()
Ends the editing of the grid cell which is currently being edited.
Declaration
public void EndEdit()
Remarks
The user can end editing in the current cell programmatically by using this method. Edited values will be committed to the GridCell.
See Also
ExpandAllGroup()
Expands all the groups in SfDataGrid.
Declaration
public void ExpandAllGroup()
Remarks
This method expands all the groups in SfDataGrid programmatically.
See Also
ExpandGroup(Group)
Expands the specified group in SfDataGrid.
Declaration
public void ExpandGroup(Group group)
Parameters
Type | Name | Description |
---|---|---|
Group | group | Specifies the group to expand it from view. |
Examples
var group = (dataGrid.View.Groups[0] as Group);
this.dataGrid.ExpandGroup(group);
See Also
ExpandGroupsAtLevel(Int32)
Expands the group based on its level.
Declaration
public void ExpandGroupsAtLevel(int groupLevel)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | groupLevel | Specifies the group level to expand the group. |
Examples
this.dataGrid.ExpandGroupsAtLevel(2);
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. |
GetUnboundCellValue(GridColumn, Object)
Gets the cell value to populate the UnboundColumn by evaluating the expression or format with the record.
Declaration
public object GetUnboundCellValue(GridColumn column, object record)
Parameters
Type | Name | Description |
---|---|---|
GridColumn | column | Specifies the corresponding column to get the cell value. |
System.Object | record | Specifies the corresponding record to get the cell value. |
Returns
Type | Description |
---|---|
System.Object | Returns the cell value of the specified column based on expression or format with the record. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when the GridUnboundColumn is defined with expression for DataTable . |
GetZoomScale()
Gets the current zoom scale of the SfDataGrid control.
Declaration
public float GetZoomScale()
Returns
Type | Description |
---|---|
System.Single | Returns the current zoom scale value of the SfDataGrid. |
InvalidateRowHeight(Int32, Boolean)
Invalidates the height of the specified row to raise in the QueryRowHeight event programmatically.
Declaration
public void InvalidateRowHeight(int rowIndex, bool canInvalidate = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | Specifies the corresponding row index to invalidate its row height. |
System.Boolean | canInvalidate | Specifies whether to invalidate the row height or not. |
Remarks
Resets the particular row height. Once row heights are reset, need to call the InvalidateMeasureInfo method of Syncfusion.SfDataGrid.XForms.SfDataGrid.VisualContainer to refresh the view.
Examples
dataGrid.InvalidateRowHeight(2, true);
InvalidateUnboundRow(GridUnboundRow, Boolean)
Invalidates the unbound row to refresh the data in View.
Declaration
public void InvalidateUnboundRow(GridUnboundRow unboundRow, bool canInvalidateColumn = true)
Parameters
Type | Name | Description |
---|---|---|
GridUnboundRow | unboundRow | Specifies the GridUnboundRow to be invalidated. |
System.Boolean | canInvalidateColumn | Specifies to whether to in invalidate columns or not. |
LayoutChildren(Double, Double, Double, Double)
Positions and sizes the children of the SfDataGrid.
Declaration
protected override void LayoutChildren(double x, double y, double width, double height)
Parameters
Type | Name | Description |
---|---|---|
System.Double | x | A value that represents the x coordinate of the child. |
System.Double | y | A value that represents the y coordinate of the child. |
System.Double | width | A value that represents the width of the child. |
System.Double | height | A value that represents the height of the child. |
MoveCurrentCellTo(RowColumnIndex, Boolean)
Moves the current cell to the specified RowColumnIndex index.
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. |
Remarks
This method is not applicable when the SelectionMode is None or NavigationMode is Row.
OnMeasure(Double, Double)
This method is called during the measure pass of a layout cycle to get the desired size of an element.
Declaration
protected override SizeRequest OnMeasure(double widthConstraint, double heightConstraint)
Parameters
Type | Name | Description |
---|---|---|
System.Double | widthConstraint | The available width for the element to use. |
System.Double | heightConstraint | The available height for the element to use. |
Returns
Type | Description |
---|---|
Xamarin.Forms.SizeRequest | A Xamarin.Forms.SizeRequest which contains the desired size of the element. |
Remarks
The results of this method will be (-1, -1) if the element has not yet been realized with a platform specific backing control. Overriding this method does not require a call to the base class so long as a valid SizeRequest is returned.
OnSizeAllocated(Double, Double)
This method is called when the size of the element is set during a layout cycle. This method is called directly before the Xamarin.Forms.VisualElement.SizeChanged event is emitted.
Declaration
protected override void OnSizeAllocated(double width, double height)
Parameters
Type | Name | Description |
---|---|---|
System.Double | width | The new width of the element. |
System.Double | height | The new height of the element. |
RaiseQueryRowHeight(QueryRowHeightEventArgs)
Raises the QueryRowHeight event.
Declaration
protected bool RaiseQueryRowHeight(QueryRowHeightEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
QueryRowHeightEventArgs | e | The QueryRowHeightEventArgs. |
Returns
Type | Description |
---|---|
System.Boolean | true, if query row height was raised, false otherwise. |
RaiseQueryUnboundRow(GridUnboundRowEventArgs)
Raises the QueryUnboundRow event in a SfDataGrid.
Declaration
protected GridUnboundRowEventArgs RaiseQueryUnboundRow(GridUnboundRowEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
GridUnboundRowEventArgs | args | Specifies the GridUnboundRowEventArgs that contains the event data. |
Returns
Type | Description |
---|---|
GridUnboundRowEventArgs | Returns the GridUnboundRowEventArgs. |
Refresh()
Refresh the view in runtime.
Declaration
public void Refresh()
RefreshContainerAndView()
The VisualContainer and the SfDataGrid view is refreshed for the first time after the ItemsSource is set. The HeaderLineCount, row and column count is updated in this method.
Declaration
protected virtual void RefreshContainerAndView()
RefreshHeaderLineCount()
The HeaderLineCount for SfDataGrid is set.
Declaration
protected virtual void RefreshHeaderLineCount()
remove_AutoGeneratingColumn(AutoGeneratingColumnEventHandler)
Declaration
public void remove_AutoGeneratingColumn(AutoGeneratingColumnEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
AutoGeneratingColumnEventHandler | value |
remove_ColumnResizing(GridResizingEventHandler)
Declaration
public void remove_ColumnResizing(GridResizingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridResizingEventHandler | value |
remove_CurrentCellBeginEdit(GridCurrentCellBeginEditEventHandler)
Declaration
public void remove_CurrentCellBeginEdit(GridCurrentCellBeginEditEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridCurrentCellBeginEditEventHandler | value |
remove_CurrentCellEndEdit(GridCurrentCellEndEditEventHandler)
Declaration
public void remove_CurrentCellEndEdit(GridCurrentCellEndEditEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridCurrentCellEndEditEventHandler | value |
remove_GridDoubleTapped(GridDoubleTappedEventHandler)
Declaration
public void remove_GridDoubleTapped(GridDoubleTappedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridDoubleTappedEventHandler | value |
remove_GridLoaded(GridLoadedEventHandler)
Declaration
public void remove_GridLoaded(GridLoadedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridLoadedEventHandler | value |
remove_GridLongPressed(GridLongPressedEventHandler)
Declaration
public void remove_GridLongPressed(GridLongPressedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridLongPressedEventHandler | value |
remove_GridTapped(GridTappedEventHandler)
Declaration
public void remove_GridTapped(GridTappedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridTappedEventHandler | value |
remove_GridViewCreated(GridViewCreatedEventHandler)
Declaration
public void remove_GridViewCreated(GridViewCreatedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridViewCreatedEventHandler | value |
remove_GroupCollapsed(GroupChangedEventHandler)
Declaration
public void remove_GroupCollapsed(GroupChangedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GroupChangedEventHandler | value |
remove_GroupCollapsing(GroupChangingEventHandler)
Declaration
public void remove_GroupCollapsing(GroupChangingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GroupChangingEventHandler | value |
remove_GroupExpanded(GroupChangedEventHandler)
Declaration
public void remove_GroupExpanded(GroupChangedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GroupChangedEventHandler | value |
remove_GroupExpanding(GroupChangingEventHandler)
Declaration
public void remove_GroupExpanding(GroupChangingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GroupChangingEventHandler | value |
remove_QueryColumnDragging(QueryColumnDraggingEventHandler)
Declaration
public void remove_QueryColumnDragging(QueryColumnDraggingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
QueryColumnDraggingEventHandler | value |
remove_QueryRowDragging(QueryRowDraggingEventHandler)
Declaration
public void remove_QueryRowDragging(QueryRowDraggingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
QueryRowDraggingEventHandler | value |
remove_QueryRowHeight(QueryRowHeightEventHandler)
Declaration
public void remove_QueryRowHeight(QueryRowHeightEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
QueryRowHeightEventHandler | value |
remove_QueryUnboundColumnValue(QueryUnboundColumnValueHandler)
Declaration
public void remove_QueryUnboundColumnValue(QueryUnboundColumnValueHandler value)
Parameters
Type | Name | Description |
---|---|---|
QueryUnboundColumnValueHandler | value |
remove_SelectionChanged(GridSelectionChangedEventHandler)
Declaration
public void remove_SelectionChanged(GridSelectionChangedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridSelectionChangedEventHandler | value |
remove_SelectionChanging(GridSelectionChangingEventHandler)
Declaration
public void remove_SelectionChanging(GridSelectionChangingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
GridSelectionChangingEventHandler | value |
remove_SortColumnsChanged(DataGridSortColumnsChangedEventHandler)
Declaration
public void remove_SortColumnsChanged(DataGridSortColumnsChangedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
DataGridSortColumnsChangedEventHandler | value |
remove_SortColumnsChanging(DataGridSortColumnsChangingEventHandler)
Declaration
public void remove_SortColumnsChanging(DataGridSortColumnsChangingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
DataGridSortColumnsChangingEventHandler | value |
remove_SwipeEnded(SwipeEndedEventHandler)
Declaration
public void remove_SwipeEnded(SwipeEndedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SwipeEndedEventHandler | value |
remove_SwipeStarted(SwipeStartedEventHandler)
Declaration
public void remove_SwipeStarted(SwipeStartedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SwipeStartedEventHandler | value |
remove_Swiping(SwipingEventHandler)
Declaration
public void remove_Swiping(SwipingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SwipingEventHandler | value |
ResetswipeOffset()
Declaration
public void ResetswipeOffset()
ResetSwipeOffset()
Reset the swipe offset of SfDataGrid. This method will reset the swiping offset programmatically when we no need to maintain the swiping after navigating to another page.
Declaration
public void ResetSwipeOffset()
ResetUnboundRowIndex()
Resets the row index of UnboundRow and its maintained for internal purpose.
Declaration
protected void ResetUnboundRowIndex()
ScrollToColumnIndex(Int32, Boolean, ScrollToPosition)
Scrolls the SfDataGrid to the column at the given index. SfDataGrid scrolls to the given column index, next to the RowHeader column if the ShowRowHeader is true.
Declaration
public Task ScrollToColumnIndex(int columnIndex, bool canAnimate = true, ScrollToPosition scrollToColumnPosition)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | columnIndex | The destination column index to scroll. |
System.Boolean | canAnimate | Boolean value indicates whether the animation is needs to be applied or not. |
Xamarin.Forms.ScrollToPosition | scrollToColumnPosition | Determines the position of the scrolled column in the datagrid. The default value is Xamarin.Forms.ScrollToPosition.Start. |
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. Animated scrolling does not have an effect on WPF platform.
See Also
ScrollToRowColumnIndex(Int32, Int32, Boolean, ScrollToPosition, ScrollToPosition)
Scrolls the SfDataGrid to given row and column index. SfDataGrid scrolls to the given column index, next to the row header column, if ShowRowHeader is set as true.
Declaration
public Task ScrollToRowColumnIndex(int rowIndex, int columnIndex, bool canAnimate = true, ScrollToPosition scrollToRowPosition, ScrollToPosition scrollToColumnPosition)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The destination row index to scroll. |
System.Int32 | columnIndex | The destination column index to scroll. |
System.Boolean | canAnimate | Boolean value indicates whether this method is called for key navigation progress. |
Xamarin.Forms.ScrollToPosition | scrollToRowPosition | Determines the position of the scrolled row in the datagrid. The default value is Xamarin.Forms.ScrollToPosition.Start. |
Xamarin.Forms.ScrollToPosition | scrollToColumnPosition | Determines the position of the scrolled column in the datagrid. The default value is Xamarin.Forms.ScrollToPosition.Start. |
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. Animated scrolling does not have an effect on WPF platform.
See Also
ScrollToRowIndex(Int32, Boolean, ScrollToPosition)
Scrolls the SfDataGrid to the row at the given index.
Declaration
public Task ScrollToRowIndex(int rowIndex, bool canAnimate = true, ScrollToPosition scrollToRowPosition)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The destination row index to scroll. |
System.Boolean | canAnimate | Boolean value indicates whether this method is called for key navigation progress. |
Xamarin.Forms.ScrollToPosition | scrollToRowPosition | Determines the position of the scrolled row in the datagrid. The default value is Xamarin.Forms.ScrollToPosition.Start. |
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. Animated scrolling does not have an effect on WPF platform.
See Also
SelectAll()
Selects all the cells in SfDataGrid when SelectionMode is Multiple.
Declaration
public void SelectAll()
SelectCell(Object, GridColumn)
Selects the cell that matches the specified row data and GridColumn.
Declaration
public void SelectCell(object rowData, GridColumn column)
Parameters
Type | Name | Description |
---|---|---|
System.Object | rowData | The row data of the cell to be selected. |
GridColumn | column | The GridColumn of the cell to be selected. |
SelectCells(Object, GridColumn, Object, GridColumn)
Selects the range of cells that falls between the specified start/end row data and start/end GridColumn.
Declaration
public void SelectCells(object startRowData, GridColumn startColumn, object endRowData, GridColumn endColumn)
Parameters
Type | Name | Description |
---|---|---|
System.Object | startRowData | The data of the first row in the range of cells to be selected. |
GridColumn | startColumn | The first GridColumn 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. |
GridColumn | endColumn | The last GridColumn in the range of cells to be selected. |
Remarks
This method is applicable only when SelectionMode is Multiple.
SetItemsSource(Object)
Sets the ItemsSource property of the grid. This method is exposed to the customer to set the ItemsSource of the grid.
Declaration
public void SetItemsSource(object source)
Parameters
Type | Name | Description |
---|---|---|
System.Object | source | The source collection that is passed by the user to be set as SfDataGrid ItemsSource. |
ShouldInvalidateOnChildAdded(View)
Method to decide whether to call Xamarin.Forms.VisualElement.InvalidateMeasure when adding a child.
Declaration
protected override bool ShouldInvalidateOnChildAdded(View child)
Parameters
Type | Name | Description |
---|---|---|
Xamarin.Forms.View | child | A child of the SfDataGrid. |
Returns
Type | Description |
---|---|
System.Boolean | A boolean value do decide whether to invalidate when adding a child. |
ShouldInvalidateOnChildRemoved(View)
Method to decide whether to call Xamarin.Forms.VisualElement.InvalidateMeasure when removing a child.
Declaration
protected override bool ShouldInvalidateOnChildRemoved(View child)
Parameters
Type | Name | Description |
---|---|---|
Xamarin.Forms.View | child | A child of the SfDataGrid. |
Returns
Type | Description |
---|---|
System.Boolean | A boolean value do decide whether to invalidate when removing a child. |
UnselectCell(Object, GridColumn)
Unselects the cell that matches the specified row data and GridColumn.
Declaration
public void UnselectCell(object rowData, GridColumn column)
Parameters
Type | Name | Description |
---|---|---|
System.Object | rowData | The row data of the cell to be unselected. |
GridColumn | column | The GridColumn of the cell to be unselected. |
UnselectCells(Object, GridColumn, Object, GridColumn)
Unselects the range of cells that falls between the specified start/end row data and start/end GridColumn.
Declaration
public void UnselectCells(object startRowData, GridColumn startColumn, object endRowData, GridColumn endColumn)
Parameters
Type | Name | Description |
---|---|---|
System.Object | startRowData | The data of the first row in the range of cells to be unselected. |
GridColumn | startColumn | The first GridColumn in the range of cells to be unselected. |
System.Object | endRowData | The data of the last row in the range of cells to be unselected. |
GridColumn | endColumn | The last GridColumn in the range of cells to be unselected. |
Remarks
This method is applicable only when SelectionMode is Multiple.
UnWireEvents()
UnWires the events in the GridModel.
Declaration
protected virtual void UnWireEvents()
WireEvents()
Wires the events in the GridModel.
Declaration
protected virtual void WireEvents()
Zoom(Single)
Applies the provided scale factor to the SfDataGrid control and zooms towards the center of the SfDataGrid.
Declaration
public void Zoom(float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Single | scaleFactor | The scale factor to be applied to the SfDataGrid. |
Examples
dataGrid.Zoom(1.5f);
Events
AutoGeneratingColumn
Occurs when AutoGenerateColumnsis set as true. Using this event, the user can customize the columns being generated automatically.
Declaration
public event AutoGeneratingColumnEventHandler AutoGeneratingColumn
Event Type
Type |
---|
AutoGeneratingColumnEventHandler |
Examples
dataGrid.AutoGeneratingColumn += DataGrid_AutoGeneratingColumn;
void DataGrid_AutoGeneratingColumn (object sender, AutoGeneratingColumnArgs e)
{
if (e.Column.MappingName == "EmployeeID")
e.Cancel = true;
}
See Also
ColumnResizing
Occurs when a column's width is being resized in SfDataGrid.
Declaration
public event GridResizingEventHandler ColumnResizing
Event Type
Type |
---|
GridResizingEventHandler |
Remarks
You can cancel or customize the column being resized through GridResizingEventArgs arguments.
Examples
dataGrid.ColumnResizing += DataGrid_ColumnResizing;
void DataGrid_ColumnResizing (object sender, GridResizingEventArgs e)
{
//You can achieve your requirement here.
if(e.Index == 2)
{
e.Cancel = true;
}
}
CurrentCellActivated
Occurs when the current cell is activated in the SfDataGrid
Declaration
public event EventHandler<CurrentCellActivatedEventArgs> CurrentCellActivated
Event Type
Type |
---|
System.EventHandler<CurrentCellActivatedEventArgs> |
Remarks
This event occurs after the CurrentCellActivatingEventArgs event if that event is not canceled.
Examples
dataGrid.CurrentCellActivated += DataGrid_CurrentCellActivated;
void DataGrid_CurrentCellActivated(object sender, CurrentCellActivatedEventArgs e)
{
// You can achieve your requirement here.
}
CurrentCellActivating
Occurs when the current cell is being activated in SfDataGrid.
Declaration
public event EventHandler<CurrentCellActivatingEventArgs> CurrentCellActivating
Event Type
Type |
---|
System.EventHandler<CurrentCellActivatingEventArgs> |
Remarks
You can cancel the current cell from being activated using the CurrentCellActivatingEventArgs
Examples
dataGrid.CurrentCellActivating += DataGrid_CurrentCellActivating;
void DataGrid_CurrentCellActivating(object sender, CurrentCellActivatingEventArgs e)
{
// You can achieve your requirement here.
}
CurrentCellBeginEdit
Occurs when entering edit mode on a grid cell in SfDataGrid.
Declaration
public event GridCurrentCellBeginEditEventHandler CurrentCellBeginEdit
Event Type
Type |
---|
GridCurrentCellBeginEditEventHandler |
Remarks
You can cancel the current cell being edited through the GridCurrentCellBeginEditEventArgs arguments.
Examples
dataGrid.CurrentCellBeginEdit += DataGrid_CurrentCellBeginEdit;
void DataGrid_CurrentCellBeginEdit (object sender, GridCurrentCellBeginEditEventArgs e)
{
//You can achieve your requirement here.
}
See Also
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 edit mode ends for the current cell which is being edited in SfDataGrid.
Declaration
public event GridCurrentCellEndEditEventHandler CurrentCellEndEdit
Event Type
Type |
---|
GridCurrentCellEndEditEventHandler |
Remarks
You can cancel committing the edited value through the GridCurrentCellEndEditEventArgs event argument.
Examples
dataGrid.CurrentCellEndEdit += DataGrid_CurrentCellEndEdit;
void DataGrid_CurrentCellEndEdit (object sender, GridCurrentCellEndEditEventArgs e)
{
//You can achieve your requirement here.
}
See Also
GridDoubleTapped
Occurs when the grid is double tapped.
Declaration
public event GridDoubleTappedEventHandler GridDoubleTapped
Event Type
Type |
---|
GridDoubleTappedEventHandler |
Examples
dataGrid.GridDoubleTapped += DataGrid_GridDoubleTapped;
void DataGrid_GridDoubleTapped (object sender, GridDoubleTappedEventArgs e)
{
if(e.RowColumnIndex.RowIndex == 1)
{
// You can achieve your requirement here.
}
}
See Also
GridLoaded
Occurs when the SfDataGrid is loaded.
Declaration
public event GridLoadedEventHandler GridLoaded
Event Type
Type |
---|
GridLoadedEventHandler |
Examples
dataGrid.GridLoaded += DataGrid_GridLoaded;
void DataGrid_GridLoaded (object sender, GridLoadedEventArgs e)
{
//You can achieve your requirement here.
}
See Also
GridLongPressed
Occurs when the SfDataGrid is long pressed.
Declaration
public event GridLongPressedEventHandler GridLongPressed
Event Type
Type |
---|
GridLongPressedEventHandler |
Examples
dataGrid.GridLongPressed += DataGrid_GridLongPressed;
void DataGrid_GridLongPressed (object sender, GridLongPressedEventArgs e)
{
if(e.RowColumnIndex.RowIndex == 1)
{
// You can achieve your requirement here.
}
}
See Also
GridTapped
Occurs when the grid is tapped.
Declaration
public event GridTappedEventHandler GridTapped
Event Type
Type |
---|
GridTappedEventHandler |
Examples
dataGrid.GridTapped += DataGrid_GridTapped;
void DataGrid_GridTapped (object sender, GridTappedEventArgs e)
{
if(e.RowColumnIndex.RowIndex == 1)
{
// You can achieve your requirement here.
}
}
See Also
GridViewCreated
Occurs when the view for a SfDataGrid is created.
Declaration
public event GridViewCreatedEventHandler GridViewCreated
Event Type
Type |
---|
GridViewCreatedEventHandler |
Examples
dataGrid.GridViewCreated += DataGrid_GridViewCreated;
void DataGrid_GridViewCreated (object sender, GridViewCreatedEventArgs e)
{
//You can achieve your requirement here.
}
See Also
GroupCollapsed
Occurs when a group is collapsed in SfDataGrid.
Declaration
public event GroupChangedEventHandler GroupCollapsed
Event Type
Type |
---|
GroupChangedEventHandler |
Remarks
This event occurs after the GroupCollapsing event, if that event is not canceled. This event will not raise when the group is collapsed programmatically.
Examples
dataGrid.GroupCollapsed += DataGrid_GroupCollapsed;
void DataGrid_GroupCollapsed (object sender, GroupChangedEventArgs e)
{
//You can achieve your requirement here.
}
See Also
GroupCollapsing
Occurs when a group is being collapsed in SfDataGrid.
Declaration
public event GroupChangingEventHandler GroupCollapsing
Event Type
Type |
---|
GroupChangingEventHandler |
Remarks
You can cancel or customize the group being collapsed through GroupChangingEventArgs arguments. This event will not raise when the group is collapsed programmatically.
Examples
dataGrid.GroupCollapsing += DataGrid_GroupCollapsing;
void DataGrid_GroupCollapsing (object sender, GroupChangingEventArgs e)
{
//You can achieve your requirement here.
e.Cancel = true;
}
See Also
GroupExpanded
Occurs when a group is expanded in SfDataGrid.
Declaration
public event GroupChangedEventHandler GroupExpanded
Event Type
Type |
---|
GroupChangedEventHandler |
Remarks
This event occurs after the GroupExpanding event, if that event is not canceled. This event will not raised when the group is expanded programmatically.
Examples
dataGrid.GroupExpanded += DataGrid_GroupExpanded;
void DataGrid_GroupExpanded (object sender, GroupChangedEventArgs e)
{
//You can achieve your requirement here.
}
See Also
GroupExpanding
Occurs when a group is being expanded in SfDataGrid.
Declaration
public event GroupChangingEventHandler GroupExpanding
Event Type
Type |
---|
GroupChangingEventHandler |
Remarks
You can cancel or customize the group being expanded through GroupChangingEventArgs arguments. This event will not be raised when the group is expanded programmatically.
Examples
dataGrid.GroupExpanding += DataGrid_GroupExpanding;
void DataGrid_GroupExpanding (object sender, GroupChangingEventArgs e)
{
//You can achieve your requirement here.
e.Cancel = true;
}
See Also
ItemsSourceChanged
Occurs when the collection bound as ItemSource of the SfDataGrid changes.
Declaration
public event EventHandler<GridItemsSourceChangedEventArgs> ItemsSourceChanged
Event Type
Type |
---|
System.EventHandler<GridItemsSourceChangedEventArgs> |
Examples
dataGrid.ItemsSourceChanged += DataGrid_ItemsSourceChanged;
void DataGrid_ItemsSourceChanged(object sender, GridItemsSourceChangedEventArgs e)
{
//You can achieve your requirement here.
}
QueryCellStyle
Occurs when each cell in a data row being queried.
Declaration
public event EventHandler<QueryCellStyleEventArgs> QueryCellStyle
Event Type
Type |
---|
System.EventHandler<QueryCellStyleEventArgs> |
Remarks
The user can apply styles such as background color, foreground color, font and font attributes in cell level using this event.
Examples
dataGrid.QueryCellStyle += DataGrid_QueryCellStyle;
void DataGrid_QueryCellStyle (object sender, QueryCellStyleEventArgs e)
{
//You can achieve your requirement here.
if (e.ColumnIndex == 0 && e.RowIndex % 3 == 1)
{
e.Style.BackgroundColor = Color.BlueViolet;
e.Style.ForegroundColor = Color.White;
}
}
QueryColumnDragging
Occurs when a column is being reordered to a new position in SfDataGrid.
Declaration
public event QueryColumnDraggingEventHandler QueryColumnDragging
Event Type
Type |
---|
QueryColumnDraggingEventHandler |
Remarks
You can cancel or customize the column being dragged through QueryColumnDraggingEventArgs arguments.
Examples
dataGrid.QueryColumnDragging += DataGrid_QueryColumnDragging;
void DataGrid_QueryColumnDragging (object sender, QueryColumnDraggingEventArgs e)
{
//You can achieve your requirement here.
if(e.To == 2)
{
e.Cancel = true;
}
}
See Also
QueryRowDragging
Occurs when a row is being reordered to a new position in SfDataGrid.
Declaration
public event QueryRowDraggingEventHandler QueryRowDragging
Event Type
Type |
---|
QueryRowDraggingEventHandler |
Remarks
You can cancel or customize the row being dragged through QueryRowDraggingEventArgs arguments.
Examples
dataGrid.QueryRowDragging += DataGrid_QueryRowDragging;
void DataGrid_QueryRowDragging (object sender, QueryRowDraggingEventArgs e)
{
//You can achieve your requirement here.
if(e.To == 2)
{
e.Cancel = true;
}
}
See Also
QueryRowHeight
Occurs when the row height of SfDataGrid is queried for each row data.
Declaration
public event QueryRowHeightEventHandler QueryRowHeight
Event Type
Type |
---|
QueryRowHeightEventHandler |
Remarks
SfDataGrid supports auto row height feature, by using this event. The user can query row the row height based on its Content and set the queried height as its row height.
Examples
dataGrid.QueryRowHeight += DataGrid_QueryRowHeight;
void DataGrid_QueryRowHeight (object sender, QueryRowHeightEventArgs e)
{
if(e.RowIndex == 1)
{
e.Height = 80;
}
e.Handled = true;
}
See Also
QueryRowStyle
Occurs when each row in SfDataGrid control being queried.
Declaration
public event EventHandler<QueryRowStyleEventArgs> QueryRowStyle
Event Type
Type |
---|
System.EventHandler<QueryRowStyleEventArgs> |
Remarks
The user can apply styles such as background color and foreground color in row level using this event.
Examples
dataGrid.QueryRowStyle += DataGrid_QueryRowStyle;
void DataGrid_QueryRowStyle (object sender, QueryRowStyleEventArgs e)
{
if (e.RowIndex == 3)
{
e.Style.ForegroundColor = Color.White;
e.Style.BackgroundColor = Color.BlueViolet;
}
}
QueryUnboundColumnValue
Occurs to query or commit the values for GridUnboundColumn when its cells is initialized or the value is committed.
Declaration
public event QueryUnboundColumnValueHandler QueryUnboundColumnValue
Event Type
Type |
---|
QueryUnboundColumnValueHandler |
Examples
dataGrid.QueryUnboundColumnValue += DataGrid_QueryUnboundColumnValue;
void DataGrid_QueryUnboundColumnValue (object sender, GridUnboundColumnEventArgs e)
{
if (e.UnboundAction == UnboundActions.QueryData)
{
var quantity = Convert.ToInt16(e.Record.GetType().GetProperty("Quantity").GetValue(e.Record));
var unitPrice = Convert.ToInt16(e.Record.GetType().GetProperty("UnitPrice").GetValue(e.Record));
var amount = quantity * unitPrice;
e.Value = amount;
}
}
See Also
QueryUnboundRow
Occurs to query and commit the value and settings for cell in Unbound row.
Declaration
public event EventHandler<GridUnboundRowEventArgs> QueryUnboundRow
Event Type
Type |
---|
System.EventHandler<GridUnboundRowEventArgs> |
Remarks
This event occurs to query data and commit in the Unbound rowGridUnboundRowEventArgs arguments.
Examples
dataGrid.QueryUnboundRow += DataGrid_QueryUnboundRow;
void DataGrid_QueryUnboundRow(object sender, GridUnboundRowEventArgs e)
{
if (e.UnboundAction == UnboundActions.QueryData)
{
if (e.RowColumnIndex.ColumnIndex == 0)
{
e.Value = (dataGrid.CurrentItem as OrderInfo).OrderID;
e.Handled = true;
}
}
}
ScrollStateChanged
Occurs when the SfDataGrid's scrolling state is changed.
Declaration
public event EventHandler<ScrollStateChangedEventArgs> ScrollStateChanged
Event Type
Type |
---|
System.EventHandler<ScrollStateChangedEventArgs> |
Examples
dataGrid.ScrollStateChanged += DataGrid_ScrollStateChanged;
void DataGrid_ScrollStateChanged (object sender, ScrollStateChangedEventArgs e)
{
// You can achieve your requirement here.
}
SelectionChanged
Occurs when selection is changed in SfDataGrid.
Declaration
public event GridSelectionChangedEventHandler SelectionChanged
Event Type
Type |
---|
GridSelectionChangedEventHandler |
Remarks
This event will raise only when the selection is done. This event will not raise if the selection is canceled in the SelectionChanging event.
Examples
dataGrid.SelectionChanged += DataGrid_SelectionChanged;
void DataGrid_SelectionChanged (object sender, GridSelectionChangedEventArgs e)
{
//You can achieve your requirement here.
}
See Also
SelectionChanging
Occurs when the selection is changing in SfDataGrid.
Declaration
public event GridSelectionChangingEventHandler SelectionChanging
Event Type
Type |
---|
GridSelectionChangingEventHandler |
Remarks
The user can cancel the selection by using this event.
Examples
dataGrid.SelectionChanging += DataGrid_SelectionChanging;
void DataGrid_SelectionChanging (object sender, GridSelectionChangingEventArgs e)
{
//You can achieve your requirement here.
}
See Also
SortColumnsChanged
Occurs after the columns is sorted in SfDataGrid.
Declaration
public event DataGridSortColumnsChangedEventHandler SortColumnsChanged
Event Type
Type |
---|
DataGridSortColumnsChangedEventHandler |
Remarks
This event will raise only when the sorting is done. This event will not raise if the sorting is canceled in the SortColumnsChanging event.
Examples
dataGrid.SortColumnsChanged += DataGrid_SortColumnsChanged;
void DataGrid_SortColumnsChanged (object sender, DataGridSortColumnsChangedEventArgs e)
{
//You can achieve your requirement here.
}
See Also
SortColumnsChanging
Occurs when the columns is being sorted in SfDataGrid.
Declaration
public event DataGridSortColumnsChangingEventHandler SortColumnsChanging
Event Type
Type |
---|
DataGridSortColumnsChangingEventHandler |
Remarks
The user can cancel the sorting based on the columns being sorted by using this event.
Examples
dataGrid.SortColumnsChanging += DataGrid_SortColumnsChanging;
void DataGrid_SortColumnsChanging (object sender, DataGridSortColumnsChangingEventArgs e)
{
//You can achieve your requirement here.
}
See Also
SwipeEnded
Occurs when swiping is ended in SfDataGrid.
Declaration
public event SwipeEndedEventHandler SwipeEnded
Event Type
Type |
---|
SwipeEndedEventHandler |
Examples
dataGrid.SwipeEnded += DataGrid_SwipeEnded;
void DataGrid_SwipeEnded (object sender, SwipeEndedEventArgs e)
{
//You can achieve your requirement here.
}
See Also
SwipeStarted
Occurs when swiping is started in SfDataGrid.
Declaration
public event SwipeStartedEventHandler SwipeStarted
Event Type
Type |
---|
SwipeStartedEventHandler |
Examples
dataGrid.SwipeStarted += DataGrid_SwipeStarted;
void DataGrid_SwipeStarted (object sender, SwipeStartedEventArgs e)
{
//You can achieve your requirement here.
}
See Also
Swiping
Occurs when swiping is in progress in SfDataGrid.
Declaration
public event SwipingEventHandler Swiping
Event Type
Type |
---|
SwipingEventHandler |
Examples
dataGrid.Swiping += DataGrid_Swiping;
void DataGrid_Swiping (object sender, SwipingEventArgs e)
{
//You can achieve your requirement here.
}
See Also
ValueChanged
Event that handles the toggle changes of switches
Declaration
public event EventHandler<ValueChangedEventArgs> ValueChanged
Event Type
Type |
---|
System.EventHandler<ValueChangedEventArgs> |
Examples
switchColumn.ValueChanged += SwitchColumn_ValueChanged;
void SwitchColumn_ValueChanged(object sender, Syncfusion.SfDataGrid.XForms.ValueChangedEventArgs e)
{
if(e.Column.MappingName == "EmployeeID" && e.NewValue.ToString() == "21345")
{
// You can achieve your requirement here.
}
}
Zooming
Occurs when the SfDataGrid is being zoomed.
Declaration
public event EventHandler<ZoomingEventArgs> Zooming
Event Type
Type |
---|
System.EventHandler<ZoomingEventArgs> |
Remarks
You can cancel the zooming interaction through the ZoomingEventArgs arguments.
Examples
dataGrid.Zooming += DataGrid_Zooming;
void DataGrid_Zooming(object sender, ZoomingEventArgs e)
{
//You can achieve your requirement here.
if (e.ZoomingState == ZoomingStates.Progressing && e.CurrentZoomScale - e.PreviousZoomScale > 0.25)
{
e.Cancel = true;
}
}
Explicit Interface Implementations
IPullToRefresh.CanCustomizeContentLayout
Gets or sets a value indicating whether to bounce SfDataGrid body region only with TransitionMode-Push or SfDataGrid to bounce with HeaderRow also.
Declaration
bool IPullToRefresh.CanCustomizeContentLayout { get; set; }
Returns
Type |
---|
System.Boolean |
IPullToRefresh.CanHandleGesture(Object)
Returns true if the SfDataGrid should handle the gestures.
Declaration
bool IPullToRefresh.CanHandleGesture(object pullToRefresh)
Parameters
Type | Name | Description |
---|---|---|
System.Object | pullToRefresh | Instance of PullToRefresh. |
Returns
Type | Description |
---|---|
System.Boolean | A System.Boolean value to handle gesture. |
IPullToRefresh.Pulling(Double, Object, out Boolean)
Raises when the pulling gesture action is started.
Declaration
void IPullToRefresh.Pulling(double progress, object pullToRefresh, out bool cancel)
Parameters
Type | Name | Description |
---|---|---|
System.Double | progress | Indicates the value of the progress indicator in agreement to the PullingThreshold. |
System.Object | pullToRefresh | Instance of PullToRefresh. |
System.Boolean | cancel | Gets or sets a value indicating whether pulling should be handled. |
IPullToRefresh.PullingCancelled(Object)
Raises when the pulling is cancelled.
Declaration
void IPullToRefresh.PullingCancelled(object pullToRefresh)
Parameters
Type | Name | Description |
---|---|---|
System.Object | pullToRefresh | Instance of PullToRefresh. |
IPullToRefresh.Refreshed(Object)
Raises when the view gets refreshed.
Declaration
void IPullToRefresh.Refreshed(object pullToRefresh)
Parameters
Type | Name | Description |
---|---|---|
System.Object | pullToRefresh | Instance of PullToRefresh. |
IPullToRefresh.Refreshing(Object)
Raises when the refreshing action is in progress once the pulling meets the PullingThreshold constraint.
Declaration
void IPullToRefresh.Refreshing(object pullToRefresh)
Parameters
Type | Name | Description |
---|---|---|
System.Object | pullToRefresh | Instance of PullToRefresh. |