Class GridCellSelectionController
Represents a class that implements the selection behavior of cell in SfDataGrid.
Inherited Members
Namespace: Syncfusion.UI.Xaml.DataGrid
Assembly: Syncfusion.Grid.WinUI.dll
Syntax
public class GridCellSelectionController : GridBaseSelectionController, IGridSelectionController, INotifyPropertyChanged, IDisposable
Constructors
GridCellSelectionController(SfDataGrid)
Initializes a new instance of GridCellSelectionController class.
Declaration
public GridCellSelectionController(SfDataGrid grid)
Parameters
Type | Name | Description |
---|---|---|
SfDataGrid | grid | The SfDataGrid . |
Methods
AddSelection(RowColumnIndex, List<Object>)
Adds the cell selection for the specified list of items and rowcolumnindex.
Declaration
protected void AddSelection(RowColumnIndex rowColumnIndex, List<object> addedItems)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | The corresponding rowcolumnindex to add cell selection. |
System.Collections.Generic.List<System.Object> | addedItems | The corresponding list of items to add the selection. |
ClearGroupSelections(Group)
Clears the cell selection in the corresponding Group.
Declaration
protected void ClearGroupSelections(Group group)
Parameters
Type | Name | Description |
---|---|---|
Group | group | The corresponding group to clear the cell selection. |
ClearSelections(Boolean, Boolean)
Clears all the selected cells in SfDataGrid.
Declaration
public override void ClearSelections(bool exceptCurrentCell, bool isProgrammatic = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | exceptCurrentCell | Decides whether the current cell selection need to be removed when the selections are cleared. |
System.Boolean | isProgrammatic | Decides whether to raise events when the selection is cleared pogrammatically. |
Overrides
Remarks
This method helps to clear the selection programmatically.
CommitAddNew(Boolean)
Commits the new item initialized on the AddNewRow to the underlying data source.
Declaration
protected override void CommitAddNew(bool changeState = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | changeState | Indicates whether watermark is enabled on the AddNewRow. |
Overrides
Dispose(Boolean)
Release all the resources used by the GridCellSelectionController class.
Declaration
protected override void Dispose(bool isDisposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isDisposing | Indicates whether the call is from Dispose method or from a finalizer. |
Overrides
GetNextCellIndex(Int32)
Gets the index of next cell corresponding to the specified index.
Declaration
protected virtual int GetNextCellIndex(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The corresponding index to get the index of next cell. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the index of next cell. |
GetNextRowIndex(Int32)
Gets the index of next row corresponding to the specified index.
Declaration
protected virtual int GetNextRowIndex(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The corresponding index to get the index of next row. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the index of next row. |
GetPreviousCellIndex(Int32)
Gets the index of previous cell corresponding to the specified index.
Declaration
protected virtual int GetPreviousCellIndex(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The corresponding index to get the previous cell index. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the index of previous cell. |
GetPreviousRowIndex(Int32)
Gets the index of previous row corresponding to the specified index.
Declaration
protected virtual int GetPreviousRowIndex(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The corresponding index to get the index of previous row. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the index of previous row. |
GetRowColumnIndex(Object, GridColumn)
Gets the corresponding RowColumnIndex of the specified row data and column.
Declaration
protected RowColumnIndex GetRowColumnIndex(object rowData, GridColumn column)
Parameters
Type | Name | Description |
---|---|---|
System.Object | rowData | The corresponding row data to get the RowColumnIndex. |
GridColumn | column | The corresponding column to get the RowColumnIndex. |
Returns
Type | Description |
---|---|
RowColumnIndex | Returns the RowColumnIndex of the specified row data and column |
GetSelectedCells()
Gets the collection of selected cells in SfDataGrid.
Declaration
public List<GridCellInfo> GetSelectedCells()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<GridCellInfo> | Returns the list of GridCellInfo collection. |
HandleCollectionChanged(NotifyCollectionChangedEventArgs, CollectionChangedReason)
Handles the cell selection when the SelectedItems, Columns and DataSource collection changes.
Declaration
public override void HandleCollectionChanged(NotifyCollectionChangedEventArgs e, CollectionChangedReason reason)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Specialized.NotifyCollectionChangedEventArgs | e | The System.Collections.Specialized.NotifyCollectionChangedEventArgs that contains data for collection changes. |
CollectionChangedReason | reason | Contains the corresponding CollectionChangedReason for collection changes. |
Overrides
Remarks
This method is not applicable when the SelectionUnit and NavigationMode is Row.
HandleDetailsViewGridKeyDown(KeyRoutedEventArgs)
Handles the cell selection when the keyboard interactions that are performed in DetailsViewDataGrid.
Declaration
public override bool HandleDetailsViewGridKeyDown(KeyRoutedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.KeyRoutedEventArgs | args | Contains information about the key that was pressed. |
Returns
Type | Description |
---|---|
System.Boolean | true if the key should be handled in DetailsViewDataGrid; otherwise, false. |
Overrides
HandleGroupExpandCollapse(Int32, Int32, Boolean)
Handles the cell selection when the group is expanded or collapsed in SfDataGrid.
Declaration
public override void HandleGroupExpandCollapse(int index, int itemsCount, bool isExpanded)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The corresponding index of the group. |
System.Int32 | itemsCount | The number of rows that are collapsed or expanded. |
System.Boolean | isExpanded | Decides whether the group is expanded or not. |
Overrides
Remarks
This method is invoked when the group is expanded or collapsed.
HandleKeyDown(KeyRoutedEventArgs)
Handles the cell selection when the keyboard interactions that are performed in SfDataGrid.
Declaration
public override bool HandleKeyDown(KeyRoutedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.KeyRoutedEventArgs | args | Contains information about the key that was pressed. |
Returns
Type | Description |
---|---|
System.Boolean | true if the key should be handled in SfDataGrid; otherwise, false. |
Overrides
HandlePointerOperations(GridPointerEventArgs, RowColumnIndex)
Handles the cell selection when any of PointerOperation such as pressed,released,moved,and etc that are performed in SfDataGrid.
Declaration
public override void HandlePointerOperations(GridPointerEventArgs args, RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
GridPointerEventArgs | args | The GridPointerEventArgs that contains the type of pointer operations and its arguments. |
RowColumnIndex | rowColumnIndex | The corresponding rowColumnIndex of the cell. |
Overrides
Remarks
This method is invoked when any of the PointerOperation are performed in SfDataGrid.
HideAllSelection(Boolean)
Hides all the cell selection background of all selected cells in SfDataGrid.
Declaration
protected void HideAllSelection(bool exceptCurrentCell)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | exceptCurrentCell | Indicates whether the selection should be hidden except for the current Cell. |
HideCellSelection(DataColumnBase)
Hides the cell selection background for the corresponding column.
Declaration
protected void HideCellSelection(DataColumnBase column)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | column | The corresponding column to hide the cell selection. |
MoveCurrentCell(RowColumnIndex, Boolean)
Moves the current cell for the specified rowColumnIndex.
Declaration
public override void MoveCurrentCell(RowColumnIndex rowColumnIndex, bool needToClearSelection = true)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | Specifies the corresponding rowColumnIndex to move the current cell. |
System.Boolean | needToClearSelection | Decides whether the current cell selection is cleared while moving the current cell. |
Overrides
Remarks
This method is not applicable when the SelectionUnit and NavigationMode is Row.
ProcessCurrentItemChanged(SelectionPropertyChangedHandlerArgs)
Processes the cell selection when the CurrentItem property value changes.
Declaration
protected override void ProcessCurrentItemChanged(SelectionPropertyChangedHandlerArgs handle)
Parameters
Type | Name | Description |
---|---|---|
SelectionPropertyChangedHandlerArgs | handle | The SelectionPropertyChangedHandlerArgs that contains the data for the CurrentItem property value changes. |
Overrides
ProcessDataReorder(Object, NotifyCollectionChangedAction)
Processes the cell selection when the data is reordered in SfDataGrid.
Declaration
protected virtual void ProcessDataReorder(object value, NotifyCollectionChangedAction action)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The corresponding value to check whether the reordered data that contains cell selection. |
System.Collections.Specialized.NotifyCollectionChangedAction | action | Indicates the corresponding collection changed actions performed on the data. |
ProcessDetailsViewGridPointerMoved(PointerRoutedEventArgs, RowColumnIndex)
Processes the cell selection when mouse pointer moved on the DetailsViewDataGrid.
Declaration
protected virtual void ProcessDetailsViewGridPointerMoved(PointerRoutedEventArgs args, RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | args | Contains the data related to the mouse move action. |
RowColumnIndex | rowColumnIndex | The corresponding rowColumnIndex where the mouse move interaction occurs. |
ProcessDetailsViewGridPointerPressed(PointerRoutedEventArgs, RowColumnIndex)
Processes the cell selection when the mouse pointer is pressed on the DetailsViewDataGrid.
Declaration
protected virtual void ProcessDetailsViewGridPointerPressed(PointerRoutedEventArgs args, RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | args | Contains the data for mouse pointer pressed action. |
RowColumnIndex | rowColumnIndex | The corresponding rowColumnIndex related to the pointer pressed location. |
Remarks
This method invoked when the pointer pressed using touch or mouse in DetailsViewDataGrid.
ProcessDetailsViewGridPointerReleased(PointerRoutedEventArgs, RowColumnIndex)
Processes the cell selection when the mouse pointer is released from the DetailsViewDataGrid.
Declaration
protected virtual void ProcessDetailsViewGridPointerReleased(PointerRoutedEventArgs args, RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | args | Contains the data for pointer released action. |
RowColumnIndex | rowColumnIndex | The corresponding rowColumnIndex related to the pointer released location. |
ProcessDetailsViewIndex(KeyRoutedEventArgs, Int32, VirtualKey, out Int32)
Processes cell selection while navigating the cell selection from parent grid to child grid .
Declaration
protected bool ProcessDetailsViewIndex(KeyRoutedEventArgs args, int rowIndex, VirtualKey processKey, out int returnIndex)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.KeyRoutedEventArgs | args | Contains data for key navigation. |
System.Int32 | rowIndex | The corresponding row index where the key navigation occurs. |
Windows.System.VirtualKey | processKey | The corresponding key that was processed. |
System.Int32 | returnIndex | The returnIndex to select the next row when DetailsViewDataGrid doesn't handle the cell selection. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the pressed key was processed in DetailsViewDataGrid; otherwise, false. |
ProcessDetailsViewKeyDown(KeyRoutedEventArgs, ref Int32, VirtualKey)
Processes the cell selection when the keyboard interactions that are performed in DetailsViewDataGrid.
Declaration
protected bool ProcessDetailsViewKeyDown(KeyRoutedEventArgs args, ref int rowIndex, VirtualKey processKey)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.KeyRoutedEventArgs | args | Contains data for key navigation. |
System.Int32 | rowIndex | The corresponding row index where the key navigation occurs. |
Windows.System.VirtualKey | processKey | The corresponding key that was processed. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the keyboard interaction that are processed in DetailsViewDataGrid; otherwise, false. |
ProcessDragSelection(PointerRoutedEventArgs, RowColumnIndex)
Processes the cell selection when the mouse pointer is dragged on the SfDataGrid.
Declaration
protected override void ProcessDragSelection(PointerRoutedEventArgs args, RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | args | Contains the data related to the mouse action. |
RowColumnIndex | rowColumnIndex | The starting rowColumnIndex of the drag selection. |
Overrides
Remarks
This method will be raised when the SelectionMode is Multiple or Extended.
ProcessDragSelection(PointerRoutedEventArgs, RowColumnIndex, RowColumnIndex, Boolean)
Processes the cell selection when the mouse pointer is dragged on the SfDataGrid.
Declaration
protected void ProcessDragSelection(PointerRoutedEventArgs args, RowColumnIndex rowColumnIndex, RowColumnIndex previousCellIndex, bool needToSelectWholeRow)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | args | Contains data related to the mouse action. |
RowColumnIndex | rowColumnIndex | The corresponding row and column index to perform drag selection. |
RowColumnIndex | previousCellIndex | Contains the previous cell index during drag operation. |
System.Boolean | needToSelectWholeRow | Indicates whether the whole row is selected while processing the drag selection on cells. |
ProcessGroupCollapsed(Int32, Int32)
Processes the cell selection when the group is collapsed.
Declaration
protected virtual void ProcessGroupCollapsed(int removeAtIndex, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | removeAtIndex | The corresponding index of the group that is collapsed from the view. |
System.Int32 | count | The number of collapsed rows count of corresponding group. |
ProcessGroupExpanded(Int32, Int32)
Processes the cell selection when the group is expanded in SfDataGrid.
Declaration
protected virtual void ProcessGroupExpanded(int insertIndex, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | insertIndex | The corresponding index of the group that is expanded in to view. |
System.Int32 | count | The number of expanded rows count of corresponding group. |
ProcessKeyDown(KeyRoutedEventArgs)
Processes the cell selection when the keyboard interactions that are performed in SfDataGrid.
Declaration
protected virtual void ProcessKeyDown(KeyRoutedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.KeyRoutedEventArgs | args | Contains the information about the key that was pressed. |
Remarks
This method helps to customize the keyboard interaction behavior in SfDataGrid.
ProcessOnAddNewRow(AddNewRowOperationHandlerArgs)
Processes the cell selection when new row is initiated or committed and the position of AddNewRow is changed.
Declaration
protected override void ProcessOnAddNewRow(AddNewRowOperationHandlerArgs handle)
Parameters
Type | Name | Description |
---|---|---|
AddNewRowOperationHandlerArgs | handle | Contains data for the AddNewRow operation. |
Overrides
ProcessOnColumnRemoved(GridColumn)
Processes the selection when the column is removed from the selected cells in SfDataGrid.
Declaration
protected virtual void ProcessOnColumnRemoved(GridColumn column)
Parameters
Type | Name | Description |
---|---|---|
GridColumn | column | The corresponding column that is removed from the selected cells. |
ProcessOnDoubleTapped(DoubleTappedRoutedEventArgs, RowColumnIndex)
Processes the selection when the mouse point is double tapped on the grid cell.
Declaration
protected virtual void ProcessOnDoubleTapped(DoubleTappedRoutedEventArgs e, RowColumnIndex currentRowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.DoubleTappedRoutedEventArgs | e | Contains the data related to the double tap interaction. |
RowColumnIndex | currentRowColumnIndex | The corresponding rowColumnIndex of the mouse point. |
Remarks
This method invoked to process selection and end edit the cell when EditTrigger is OnDoubleTap.
ProcessOnFilterApplied(GridFilteringEventArgs)
Processes the cell selection when filtering is applied in SfDataGrid.
Declaration
protected override void ProcessOnFilterApplied(GridFilteringEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
GridFilteringEventArgs | args | Contains the data related to filtering operation. |
Overrides
ProcessOnFilterPopupOpened()
Processes the cell selection when the filter popup is opened.
Declaration
protected override void ProcessOnFilterPopupOpened()
Overrides
Remarks
This method refreshes the cell selection while opening the filter popup in SfDataGrid.
ProcessOnFilterRowPositionChanged(DependencyPropertyChangedEventArgs)
Processes the selection when the position of FilterRow is changed.
Declaration
protected override void ProcessOnFilterRowPositionChanged(DependencyPropertyChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.DependencyPropertyChangedEventArgs | args | Contains data for the FilterRow position changed. |
Overrides
ProcessOnGroupChanged(GridGroupingEventArgs)
Processes the cell selection when the column is grouped in SfDataGrid.
Declaration
protected override void ProcessOnGroupChanged(GridGroupingEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
GridGroupingEventArgs | args | Contains the data related to the grouping operation. |
Overrides
Remarks
This method refreshes the selection while grouping the column in SfDataGrid.
ProcessOnPageChanged()
Processes the cell selection while navigating from one page in to another page in SfDataPager.
Declaration
protected override void ProcessOnPageChanged()
Overrides
ProcessOnPaste(List<Object>)
Processes the cell selection when the records is pasted from the clipboard into SfDataGrid.
Declaration
protected override void ProcessOnPaste(List<object> records)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.Object> | records | Contains the list of records that is pasted into SfDataGrid. |
Overrides
ProcessOnRowHeaderChanged()
Processes the cell selection when the ShowRowHeader property value changes.
Declaration
public override void ProcessOnRowHeaderChanged()
Overrides
ProcessOnSortChanged(SortColumnChangedHandle)
Processes the cell selection when the column is sorted in SfDataGrid.
Declaration
protected override void ProcessOnSortChanged(SortColumnChangedHandle sortcolumnHandle)
Parameters
Type | Name | Description |
---|---|---|
SortColumnChangedHandle | sortcolumnHandle | Contains information related to the sorting action. |
Overrides
Remarks
This method refreshes the selection while sorting the column in SfDataGrid and clear the selection in summary rows.
ProcessOnStackedHeaderRows(StackedHeaderCollectionChangedEventArgs)
Processes the cell selection when the stacked header collection changes in SfDataGrid.
Declaration
protected override void ProcessOnStackedHeaderRows(StackedHeaderCollectionChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
StackedHeaderCollectionChangedEventArgs | args | Contains data for stacked header collection changes. |
Overrides
ProcessOnTapped(TappedRoutedEventArgs, RowColumnIndex)
Processes the cell selection when the mouse point is tapped on the grid cell.
Declaration
protected virtual void ProcessOnTapped(TappedRoutedEventArgs e, RowColumnIndex currentRowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.TappedRoutedEventArgs | e | Contains the data related to the tap interaction. |
RowColumnIndex | currentRowColumnIndex | The corresponding rowColumnIndex of the mouse point. |
Remarks
This method invoked to process selection and end edit the cell when EditTrigger is OnTap.
ProcessPointerMoved(PointerRoutedEventArgs, RowColumnIndex)
Processes the cell selection when mouse pointer moved on the SfDataGrid.
Declaration
protected virtual void ProcessPointerMoved(PointerRoutedEventArgs args, RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | args | Contains the data related to the mouse move action. |
RowColumnIndex | rowColumnIndex | The corresponding rowColumnIndex related to the mouse point. |
ProcessPointerPressed(PointerRoutedEventArgs, RowColumnIndex)
Processes the cell selection when the mouse pointer is pressed in SfDataGrid.
Declaration
protected virtual void ProcessPointerPressed(PointerRoutedEventArgs args, RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | args | Contains the data for mouse pointer action. |
RowColumnIndex | rowColumnIndex | The corresponding rowColumnIndex of the pressed point location. |
Remarks
This method will be invoked when the pointer is pressed using touch or mouse in SfDataGrid. The selection is initialized in pointer pressed state when the AllowSelectionOnPointerPressed set as true.
ProcessPointerReleased(PointerRoutedEventArgs, RowColumnIndex)
Processes the cell selection when the mouse pointer is released in SfDataGrid.
Declaration
protected virtual void ProcessPointerReleased(PointerRoutedEventArgs args, RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | args | Contains the data for mouse pointer action. |
RowColumnIndex | rowColumnIndex | The corresponding rowColumnIndex of mouse released point. |
Remarks
The selection is initialized in pointer released state when the AllowSelectionOnPointerPressed set as false.
ProcessPointerSelection(PointerRoutedEventArgs, RowColumnIndex, Boolean)
Processes the cell selection when the pointer pressed or released interactions performed in SfDataGrid.
Declaration
protected void ProcessPointerSelection(PointerRoutedEventArgs args, RowColumnIndex rowColumnIndex, bool needToSelectWholeRow)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | args | Contains the data for mouse pointer action. |
RowColumnIndex | rowColumnIndex | The corresponding rowColumnIndex related to the mouse position. |
System.Boolean | needToSelectWholeRow | Indicates whether the whole row need to be selected or not. |
ProcessSelectedIndexChanged(SelectionPropertyChangedHandlerArgs)
Processes the cell selection when the SelectedIndex property value changes.
Declaration
protected override void ProcessSelectedIndexChanged(SelectionPropertyChangedHandlerArgs handle)
Parameters
Type | Name | Description |
---|---|---|
SelectionPropertyChangedHandlerArgs | handle | The SelectionPropertyChangedHandlerArgs contains the data for the SelectedIndex property value changes. |
Overrides
ProcessSelectedItemChanged(SelectionPropertyChangedHandlerArgs)
Processes the cell selection when the SelectedItem property value changes.
Declaration
protected override void ProcessSelectedItemChanged(SelectionPropertyChangedHandlerArgs handle)
Parameters
Type | Name | Description |
---|---|---|
SelectionPropertyChangedHandlerArgs | handle | The SelectionPropertyChangedHandlerArgs that contains the data for the SelectedItem property value changes. |
Overrides
ProcessSelection(RowColumnIndex, SelectionReason, Boolean)
Processes the cell selection for the specified row and column index.
Declaration
protected bool ProcessSelection(RowColumnIndex newRowColumnIndex, SelectionReason reason, bool needWholeRowSelect = false)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | newRowColumnIndex | The corresponding rowcolumnindex to select the cell. |
SelectionReason | reason | Contains the selection reason to select the cell. |
System.Boolean | needWholeRowSelect | Indicates whether the whole row is selected while processing the cell selection. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the cell selection is processed to corresponding row and column index; otherwise, false. |
ProcessSelectionModeChanged(SelectionPropertyChangedHandlerArgs)
Processes the cell selection when the SelectionMode property value changes.
Declaration
protected override void ProcessSelectionModeChanged(SelectionPropertyChangedHandlerArgs handle)
Parameters
Type | Name | Description |
---|---|---|
SelectionPropertyChangedHandlerArgs | handle | The SelectionPropertyChangedHandlerArgs contains the data for the SelectionMode property value changes. |
Overrides
ProcessShiftSelection(RowColumnIndex, RowColumnIndex, VirtualKey, Boolean)
Processes the selection when the cells selected by using Shift key.
Declaration
protected void ProcessShiftSelection(RowColumnIndex newRowColumnIndex, RowColumnIndex previousRowColumnIndex, VirtualKey key, bool needToSelectWholeRow = false)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | newRowColumnIndex | The corresponding row and column index to perform shift cell selection. |
RowColumnIndex | previousRowColumnIndex | Contains the previous row and column index. |
Windows.System.VirtualKey | key | Contains the key that was pressed. |
System.Boolean | needToSelectWholeRow | Indicates whether the whole row is selected while processing the shift cell selection. |
ProcessSourceCollectionChanged(NotifyCollectionChangedEventArgs, CollectionChangedReason)
Processes the cell selection when the ItemsSource property value changes.
Declaration
protected virtual void ProcessSourceCollectionChanged(NotifyCollectionChangedEventArgs e, CollectionChangedReason reason)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Specialized.NotifyCollectionChangedEventArgs | e | The System.Collections.Specialized.NotifyCollectionChangedEventArgs that contains data for source collection changes. |
CollectionChangedReason | reason | The CollectionChangedReason contains reason for the source collection changes. |
ProcessTableSummaryChanged(TableSummaryPositionChangedEventArgs)
Processes the cell selection when the table summary row position has changed.
Declaration
protected override void ProcessTableSummaryChanged(TableSummaryPositionChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
TableSummaryPositionChangedEventArgs | args | Contains the data for the table summary row position changes. |
Overrides
ProcessUnboundRowChanged(UnboundDataRowCollectionChangedEventArgs)
Processes the cell selection when the UnboundRow collection changes.
Declaration
protected override void ProcessUnboundRowChanged(UnboundDataRowCollectionChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
UnboundDataRowCollectionChangedEventArgs | args | Contains data for the UnboundRow collection changes. |
Overrides
RefreshSelectedCells()
Refreshes the SelectedCells collection in SfDataGrid.
Declaration
protected void RefreshSelectedCells()
Remarks
This method refresh the SelectedCells collection when the grid related operations are performed.
RemoveSelection(List<Object>)
Removes the selection for the specified list of items and rowcolumnindex.
Declaration
protected void RemoveSelection(List<object> removedItems)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.Object> | removedItems | The corresponding list of items to remove the cell selection. |
ResetSelectedCells(Boolean)
Updates the SelectedCells based on row data and removes the cells from the SelectedCells collection that is not in currently in view.
Declaration
public void ResetSelectedCells(bool canUpdateCurrentCell = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | canUpdateCurrentCell | true, if the current cell is need to be updated during reset the SelectedCells. |
Remarks
The SelectedCells collection updated only for record cells and other selection will be removed.
ResetSelectedCells(ref List<Object>)
Resets the SelectedCells based on the selection added or removed in SfDataGrid .
Declaration
protected void ResetSelectedCells(ref List<object> removedItems)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.Object> | removedItems | the removed items. |
Remarks
The SelectedCells collection updated only for record cells and other selection will be removed.
ResetSelection(RowColumnIndex, List<Object>, Boolean)
Resets the selection for the specified row and column index.
Declaration
protected void ResetSelection(RowColumnIndex rowColumnIndex, List<object> removedItems, bool setFocusGrid = true)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | The corresponding rowcolumnindex to reset the cell selection. |
System.Collections.Generic.List<System.Object> | removedItems | The corresponding list of items to reset the cell selection. |
System.Boolean | setFocusGrid | Indicates whether the focus is set to SfDataGrid after reset the selection. |
SelectAll(Boolean)
Selects all the cells in SfDataGrid.
Declaration
public override void SelectAll(bool canFocus = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | canFocus | Decides whether the focus can be set to the current cell. |
Overrides
Remarks
This method only works for Multiple and Extended mode selection.
SelectCell(Object, GridColumn, Boolean)
Selects the cell for the specified row data and column.
Declaration
public void SelectCell(object rowData, GridColumn column, bool canFocus = true)
Parameters
Type | Name | Description |
---|---|---|
System.Object | rowData | Specifies the corresponding rowData to select the cell. |
GridColumn | column | Specifies the corresponding column to select the cell. |
System.Boolean | canFocus | Decides whether the focus can be set to the current cell. |
SelectCells(Object, GridColumn, Object, GridColumn, Boolean)
Selects the range of cells for the specified row data and column information .
Declaration
public void SelectCells(object startRowData, GridColumn startColumn, object endRowData, GridColumn endColumn, bool canFocus = true)
Parameters
Type | Name | Description |
---|---|---|
System.Object | startRowData | Specifies the starting row position to select. |
GridColumn | startColumn | Specifies the starting column position to select. |
System.Object | endRowData | Specifies the ending row position to select. |
GridColumn | endColumn | Specifies the ending column position to select. |
System.Boolean | canFocus | Decides whether the focus can be set to the current cell. |
Remarks
This method is not applicable for Single and None selection mode.
SelectRows(Int32, Int32)
Selects the rows corresponding to the specified start and end index of the row.
Declaration
public override void SelectRows(int startRowIndex, int endRowIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | startRowIndex | The start index of the row. |
System.Int32 | endRowIndex | The end index of the row. |
Overrides
ShowCellSelection(DataColumnBase)
Shows the cell selection background for the corresponding column.
Declaration
protected void ShowCellSelection(DataColumnBase column)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | column | The corresponding column to show cell selection. |
UnselectCell(Object, GridColumn)
Unselects the cell for the specified row data and column.
Declaration
public void UnselectCell(object rowData, GridColumn column)
Parameters
Type | Name | Description |
---|---|---|
System.Object | rowData | Specifies the corresponding rowData to unselect. |
GridColumn | column | Specifies the corresponding column to unselect. |
UnselectCells(Object, GridColumn, Object, GridColumn)
Unselects the range of cells for the specified row data and column information.
Declaration
public void UnselectCells(object startRowData, GridColumn startColumn, object endRowData, GridColumn endColumn)
Parameters
Type | Name | Description |
---|---|---|
System.Object | startRowData | Specifies the starting row position to unselect. |
GridColumn | startColumn | Specifies the starting column position to unselect. |
System.Object | endRowData | Specifies the ending row position to unselect. |
GridColumn | endColumn | Specifies the ending column position to unselect. |
Remarks
This method is not applicable for Single and None selection mode.
UpdateCurrentCell(Boolean, Boolean)
Updates the current cell based on CurrentItem property value changes.
Declaration
protected void UpdateCurrentCell(bool skipIfNotDataRow = true, bool canFocusGrid = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | skipIfNotDataRow | Indicates whether the update for current cell is skipped other than data row. |
System.Boolean | canFocusGrid | If true, the Focus will be set to SfDataGrid. |