Interface IGridSelectionController
Provides the common functionality of selection behavior in SfDataGrid.
Namespace: Syncfusion.UI.Xaml.Grid
Assembly: Syncfusion.SfGrid.WPF.dll
Syntax
public interface IGridSelectionController : INotifyPropertyChanged, IDisposable
Properties
CurrentCellManager
Gets the reference to the GridCurrentCellManager instance which holds the current cell information.
Declaration
GridCurrentCellManager CurrentCellManager { get; }
Property Value
Type |
---|
GridCurrentCellManager |
GroupRowSelectionBrush
Gets or sets a brush that highlights the background of currently selected group caption and group summary rows.
Declaration
Brush GroupRowSelectionBrush { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Brush | The brush that highlights the background of currently selected group row. |
RowHoverBackgroundBrush
Gets or sets a brush that highlights the background of data row is being hovered.
Declaration
Brush RowHoverBackgroundBrush { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Brush | The brush that highlights the data row is being hovered. |
RowSelectionBrush
Gets or sets a brush that highlights the background of the currently selected row or cell.
Declaration
Brush RowSelectionBrush { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Brush | The brush that highlights the background of the selected row or cell. |
SelectedCells
Returns the collection of
Declaration
GridSelectedCellsCollection SelectedCells { get; }
Property Value
Type |
---|
GridSelectedCellsCollection |
SelectedRows
Returns the collection of GridRowInfo that contains the information of selected rows.
Declaration
GridSelectedRowsCollection SelectedRows { get; }
Property Value
Type |
---|
GridSelectedRowsCollection |
Methods
ClearSelections(Boolean, Boolean)
Clears all the selected cells or rows in SfDataGrid.
Declaration
void ClearSelections(bool exceptCurrentRow, bool isProgrammatic = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | exceptCurrentRow | Decides whether the current row or cell selection should be removed while clearing the selections from SfDataGrid. |
System.Boolean | isProgrammatic |
HandleCollectionChanged(NotifyCollectionChangedEventArgs, CollectionChangedReason)
Handles the selection when the collection is changed.
Declaration
void HandleCollectionChanged(NotifyCollectionChangedEventArgs e, CollectionChangedReason reason)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Specialized.NotifyCollectionChangedEventArgs | e | The System.Collections.Specialized.NotifyCollectionChangedEventArgs |
CollectionChangedReason | reason | Contains the CollectionChangedReason for collection changes. |
HandleDetailsViewGridKeyDown(KeyEventArgs)
Handles the selection when the keyboard interactions that are performed in DetailsViewDataGrid.
Declaration
bool HandleDetailsViewGridKeyDown(KeyEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.KeyEventArgs | args | Contains information about the key that was pressed. |
Returns
Type | Description |
---|---|
System.Boolean | true if the key was processed; otherwise, false. |
HandleGridOperations(GridOperationsHandlerArgs)
Handles the selection when any of the GridOperation such as Sorting,Filtering,Grouping and etc that are performed in SfDataGrid.
Declaration
void HandleGridOperations(GridOperationsHandlerArgs args)
Parameters
Type | Name | Description |
---|---|---|
GridOperationsHandlerArgs | args | The GridOperationsHandlerArgs that contains the type of grid operations and its arguments. |
HandleGroupExpandCollapse(Int32, Int32, Boolean)
Handles the when the group is expanded or collapsed in SfDataGrid.
Declaration
void HandleGroupExpandCollapse(int index, int count, bool isExpanded)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The corresponding index of the group. |
System.Int32 | count | The number of rows that are collapsed or expanded. |
System.Boolean | isExpanded | Specifies whether the group is expanded or not. |
HandleKeyDown(KeyEventArgs)
Handles the selection when the keyboard interactions that are performed in SfDataGrid.
Declaration
bool HandleKeyDown(KeyEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.KeyEventArgs | args | Contains information about the key that was pressed. |
Returns
Type | Description |
---|---|
System.Boolean | true if the key was processed; otherwise, false. |
HandlePointerOperations(GridPointerEventArgs, RowColumnIndex)
Handles the selection when any of the PointerOperation such as pressed,released,moved,and etc that are performed in SfDataGrid.
Declaration
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. |
HandleSelectionPropertyChanges(SelectionPropertyChangedHandlerArgs)
Handles the selection when any of the selection property such as SelectedIndex,SelectedItem and SelectionMode values changed.
Declaration
void HandleSelectionPropertyChanges(SelectionPropertyChangedHandlerArgs handle)
Parameters
Type | Name | Description |
---|---|---|
SelectionPropertyChangedHandlerArgs | handle | The SelectionPropertyChangedHandlerArgs that contains the corresponding property name and its value changes. |
MoveCurrentCell(RowColumnIndex, Boolean)
Moves the current cell for the specified rowColumnIndex.
Declaration
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 row selection need to be cleared while moving the current cell. |
SelectAll(Boolean)
Selects all the rows or cells in SfDataGrid.
Declaration
void SelectAll(bool canFocus = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | canFocus | Decides whether the focus can be set to the current cell. |
SelectRows(Int32, Int32)
Selects the rows corresponding to the specified start and end index of the row.
Declaration
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. |