Class DataGridSelectionController
Represents a base class that manages the selection operations in the SfDataGrid.
Implements
Namespace: Syncfusion.Maui.DataGrid
Assembly: Syncfusion.Maui.DataGrid.dll
Syntax
public abstract class DataGridSelectionController : Object, IDisposable
Constructors
DataGridSelectionController(SfDataGrid)
Initializes a new instance of the
Declaration
public DataGridSelectionController(SfDataGrid dataGrid)
Parameters
Type | Name | Description |
---|---|---|
SfDataGrid | dataGrid | The |
Properties
DataGrid
Gets the reference of the SfDataGrid.
Declaration
public SfDataGrid DataGrid { get; }
Property Value
Type |
---|
SfDataGrid |
SelectedRows
Gets or sets the selected rows in the SfDataGrid.
Declaration
public DataGridSelectedRowsCollection SelectedRows { get; set; }
Property Value
Type |
---|
Syncfusion.Maui.DataGrid.DataGridSelectedRowsCollection |
Methods
ApplySelection(RowColumnIndex, Boolean)
Applies selection to the cell/row at the specified row and column index based on the
Declaration
protected abstract void ApplySelection(RowColumnIndex rowColumnIndex, bool isfromNavigationKeys = false)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | Specifies the row and column position to select. |
System.Boolean | isfromNavigationKeys | Specifies the isfromNavigationKeys to select. |
ClearSelection()
Clears the selection in a SfDataGrid control.
Declaration
public void ClearSelection()
Dispose()
Perform final clean up before it is released from memory.
Declaration
public virtual void Dispose()
Dispose(Boolean)
Releases the unmanaged resources used by the component and optionally releases the managed resources.
Declaration
protected abstract void Dispose(bool isDisposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isDisposing | if true - release both managed and unmanaged resources; if false - release only unmanaged resources. |
ProcessCurrentItemChanged(DataGridSelectionPropertyChangedEventArgs)
Processes selection when the
Declaration
protected abstract void ProcessCurrentItemChanged(DataGridSelectionPropertyChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DataGridSelectionPropertyChangedEventArgs | args | SelectionPropertyChangedHandler arguments. |
Remarks
When SelectionMode is Microsoft.Maui.Controls.SelectionMode.Multiple the last selected item is stored in the
ProcessOnGroupChanged(DataGridGroupDescriptionChangedEventArgs)
Processes the selection when group column descriptions is changed.
Declaration
protected abstract void ProcessOnGroupChanged(DataGridGroupDescriptionChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataGridGroupDescriptionChangedEventArgs | e |
ProcessOnSortChanged(DataGridSortDescriptionChangedEventArgs)
Processes selection when
Declaration
protected abstract void ProcessOnSortChanged(DataGridSortDescriptionChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataGridSortDescriptionChangedEventArgs | e |
Remarks
Application developers can override this to get notified when the
ProcessSelectedIndexChanged(DataGridSelectionPropertyChangedEventArgs)
Processes selection when the SelectedIndex changes.
Declaration
protected abstract void ProcessSelectedIndexChanged(DataGridSelectionPropertyChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DataGridSelectionPropertyChangedEventArgs | args |
Remarks
When
ProcessSelectedItemChanged(DataGridSelectionPropertyChangedEventArgs)
Processes selection when the
Declaration
protected abstract void ProcessSelectedItemChanged(DataGridSelectionPropertyChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DataGridSelectionPropertyChangedEventArgs | args |
Remarks
Application developers can override this to get notified when the
ProcessSelectionModeChanged(DataGridSelectionPropertyChangedEventArgs)
Processes selection when the SelectionMode changes.
Declaration
protected abstract void ProcessSelectionModeChanged(DataGridSelectionPropertyChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DataGridSelectionPropertyChangedEventArgs | args |
Remarks
When SelectionMode is changed from multiple to single/singleDeselect clears all the selection expect last selection. Application developers can override this to get notified when the SelectionMode chagnes.
ProcessSourceCollectionChanged(NotifyCollectionChangedEventArgs, CollectionChangedReason)
Processes selection when the source collection changes in SfDataGrid control.
Declaration
protected abstract void ProcessSourceCollectionChanged(NotifyCollectionChangedEventArgs e, CollectionChangedReason reason)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Specialized.NotifyCollectionChangedEventArgs | e | The System.Collections.Specialized.NotifyCollectionChangedEventArgs. |
Syncfusion.Maui.DataGrid.CollectionChangedReason | reason | The Syncfusion.Maui.DataGrid.CollectionChangedReason. |
Remarks
Application developers can override this to get notified when the items source collection changes in SfDataGrid.
RaiseSelectionChanged(List<Object>, List<Object>)
Raises the SelectionChanged event in a
Declaration
protected void RaiseSelectionChanged(List<object> addedItems, List<object> removedItems)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.Object> | addedItems | The list of added items. |
System.Collections.Generic.List<System.Object> | removedItems | The list of removed items. |
RaiseSelectionChanging(List<Object>, List<Object>)
Raises the SelectionChanging event in a
Declaration
protected bool RaiseSelectionChanging(List<object> addedItems, List<object> removedItems)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.Object> | addedItems | The list of added items. |
System.Collections.Generic.List<System.Object> | removedItems | The list of removed items. |
Returns
Type | Description |
---|---|
System.Boolean | A boolean value specifying whether the selection is changed. |
ResumeUpdates()
Resumes usual selection operation in SfDataGrid.
Declaration
protected void ResumeUpdates()
SelectAll()
Selects all the cells in SfDataGrid.
Declaration
protected abstract void SelectAll()
Remarks
This method is applicable only when SelectionMode is Microsoft.Maui.Controls.SelectionMode.Multiple.
SuspendUpdates()
Temporarily suspends the updates for the selection operation in SfDataGrid.
Declaration
protected void SuspendUpdates()