Class TreeGridBaseSelectionController
Provides the base implementation for selection in SfTreeGrid.
Namespace: Syncfusion.UI.Xaml.TreeGrid
Assembly: Syncfusion.Grid.WinUI.dll
Syntax
public abstract class TreeGridBaseSelectionController : Object, ITreeGridSelectionController, IDisposable
Constructors
TreeGridBaseSelectionController(SfTreeGrid)
Initializes a new instance of TreeGridBaseSelectionController class.
Declaration
public TreeGridBaseSelectionController(SfTreeGrid treeGrid)
Parameters
Type | Name | Description |
---|---|---|
SfTreeGrid | treeGrid | The corresponding SfTreeGrid instance. |
Properties
CurrentCellManager
Gets the reference to the TreeGridCurrentCellManager instance which holds the current cell information.
Declaration
public TreeGridCurrentCellManager CurrentCellManager { get; protected set; }
Property Value
Type |
---|
TreeGridCurrentCellManager |
Remarks
TreeGridCurrentCellManager creates the current cell and manages the current cell related operations.
IsSuspended
Gets a value to suspend the selection operations that are performed internally.
Declaration
protected bool IsSuspended { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the selection operations is suspended; otherwise , false. |
PressedRowColumnIndex
Gets or sets the pressed RowColumnIndex of SfTreeGrid.
Declaration
protected RowColumnIndex PressedRowColumnIndex { get; set; }
Property Value
Type |
---|
RowColumnIndex |
SelectedRows
Gets or sets the collection of TreeGridRowInfo that contains the information of selected rows.
Declaration
public TreeGridSelectedRowsCollection SelectedRows { get; protected set; }
Property Value
Type | Description |
---|---|
TreeGridSelectedRowsCollection | The collection of TreeGridRowInfo . |
TreeGrid
Gets or sets the reference to the SfTreeGrid control.
Declaration
protected SfTreeGrid TreeGrid { get; set; }
Property Value
Type | Description |
---|---|
SfTreeGrid | The reference to the SfTreeGrid control. |
Methods
ChangeFlowDirectionKey(ref VirtualKey)
Changes the flow direction of key navigation based on the Windows.UI.Xaml.FlowDirection in SfTreeGrid.
Declaration
protected void ChangeFlowDirectionKey(ref VirtualKey currentKey)
Parameters
Type | Name | Description |
---|---|---|
Windows.System.VirtualKey | currentKey | Contains the key that was pressed. |
ClearSelections(Boolean)
Clears all the selected rows in SfTreeGrid.
Declaration
public abstract void ClearSelections(bool exceptCurrentRow)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | exceptCurrentRow | Decides whether the current selection can be cleared or not. |
CreateCurrentCellManager()
Creates the current cell and manages the current cell related operations in SfTreeGrid.
Declaration
protected virtual TreeGridCurrentCellManager CreateCurrentCellManager()
Returns
Type | Description |
---|---|
TreeGridCurrentCellManager | Returns the corresponding TreeGridCurrentCellManager instance. |
Dispose()
Disposes all the resources used by the TreeGridBaseSelectionController class.
Declaration
public void Dispose()
Dispose(Boolean)
Disposes all the resources used by the TreeGridBaseSelectionController class.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Indicates whether the call is from Dispose method or from a finalizer. |
HandleCollectionChanged(NotifyCollectionChangedEventArgs, TreeGridCollectionChangedReason)
Handles the selection when the SelectedItems, Columns and DataSource property collection changes.
Declaration
public abstract void HandleCollectionChanged(NotifyCollectionChangedEventArgs e, TreeGridCollectionChangedReason reason)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Specialized.NotifyCollectionChangedEventArgs | e | The System.Collections.Specialized.NotifyCollectionChangedEventArgs that contains data for collection changes. |
TreeGridCollectionChangedReason | reason | The TreeGridCollectionChangedReason contains reason for the collection changes. |
Remarks
This method is called when the collection changes on SelectedItems, Columns and DataSource properties in SfTreeGrid.
HandleGridOperations(TreeGridOperationsHandlerArgs)
Handles selection when any of the TreeGridOperation such as Sorting performed in SfTreeGrid.
Declaration
public virtual void HandleGridOperations(TreeGridOperationsHandlerArgs args)
Parameters
Type | Name | Description |
---|---|---|
TreeGridOperationsHandlerArgs | args | The TreeGridOperationsHandlerArgs that contains the type of grid operations and its arguments. |
Remarks
This method is called when any of the TreeGridOperation are performed in SfTreeGrid.
HandleKeyDown(KeyRoutedEventArgs)
Handles the selection for the keyboard interactions that are performed in SfTreeGrid.
Declaration
public abstract 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 SfTreeGrid; otherwise, false. |
HandleNodeExpandCollapse(Int32, Int32, Boolean)
Handles the selection when the node is expanded or collapsed in SfTreeGrid.
Declaration
public abstract void HandleNodeExpandCollapse(int index, int count, bool isExpanded)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The corresponding index of the node. |
System.Int32 | count | The number of rows that are collapsed or expanded. |
System.Boolean | isExpanded | Specifies whether the node is expanded or not. |
Remarks
This method is invoked when the node is expanded or collapsed.
HandleNodeOperations(NodeOperation)
Processes the selection when the node is expanded/collapsed in SfTreeGrid.
Declaration
protected abstract void HandleNodeOperations(NodeOperation NodeOperation)
Parameters
Type | Name | Description |
---|---|---|
NodeOperation | NodeOperation | Contains the value for collection changes during expanding/collapsing action. |
Remarks
This method refreshes the selection while expanding/collapsing the node in SfTreeGrid.
HandlePointerOperations(GridPointerEventArgs, RowColumnIndex)
Handles selection when any of the PointerOperation such as pressed,released,moved,and etc performed in SfTreeGrid.
Declaration
public virtual 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. |
Remarks
This method is invoked when any of the PointerOperation are performed in SfTreeGrid.
HandleSelectionPropertyChanges(SelectionPropertyChangedHandlerArgs)
Handles selection when the selection property such as SelectedIndex,SelectedItem and SelectionMode value changes occurred.
Declaration
public virtual void HandleSelectionPropertyChanges(SelectionPropertyChangedHandlerArgs handle)
Parameters
Type | Name | Description |
---|---|---|
SelectionPropertyChangedHandlerArgs | handle | The SelectionPropertyChangedHandlerArgs that contains the corresponding property name and its value changes. |
Remarks
This method is invoked when the selection property values such as SelectedIndex,SelectedItem and SelectionMode are changed in SfTreeGrid.
MoveCurrentCell(RowColumnIndex, Boolean)
Moves the current cell for the specified rowColumnIndex.
Declaration
public abstract 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 selection is cleared while moving the current cell. |
Remarks
This method is not applicable when NavigationMode is Row.
ProcessCurrentItemChanged(SelectionPropertyChangedHandlerArgs)
Processes the selection when the CurrentItem property value changes.
Declaration
protected virtual void ProcessCurrentItemChanged(SelectionPropertyChangedHandlerArgs handle)
Parameters
Type | Name | Description |
---|---|---|
SelectionPropertyChangedHandlerArgs | handle | The SelectionPropertyChangedHandlerArgs contains the data for the CurrentItem property value changes. |
ProcessNavigationModeChanged(SelectionPropertyChangedHandlerArgs)
Processes the selection when the NavigationMode property value changes.
Declaration
protected virtual void ProcessNavigationModeChanged(SelectionPropertyChangedHandlerArgs handle)
Parameters
Type | Name | Description |
---|---|---|
SelectionPropertyChangedHandlerArgs | handle | The SelectionPropertyChangedHandlerArgs contains the data for the NavigationMode property value changes. |
ProcessOnDoubleTapped(RowColumnIndex)
Processes the selection when the mouse point is double tapped on the particular cell in a row.
Declaration
protected abstract void ProcessOnDoubleTapped(RowColumnIndex currentRowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
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.
ProcessOnRowHeaderChanged()
Processes the selection when the ShowRowHeader property value changes.
Declaration
protected virtual void ProcessOnRowHeaderChanged()
ProcessOnSortChanged(SortColumnChangedHandle)
Processes the selection when the column is sorted in SfTreeGrid.
Declaration
protected abstract void ProcessOnSortChanged(SortColumnChangedHandle sortColumnHandle)
Parameters
Type | Name | Description |
---|---|---|
SortColumnChangedHandle | sortColumnHandle | Contains information related to the sorting action. |
Remarks
This method refreshes the selection while sorting the column in SfTreeGrid.
ProcessOnTapped(TappedRoutedEventArgs, RowColumnIndex)
Processes the cell selection when the mouse point is tapped on the grid cell.
Declaration
protected abstract 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 row selection when mouse pointer is moved on the SfTreeGrid.
Declaration
protected abstract void ProcessPointerMoved(PointerRoutedEventArgs args, RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | args | Contains the data for mouse related interaction. |
RowColumnIndex | rowColumnIndex | The corresponding rowColumnIndex related to the mouse point. |
ProcessPointerPressed(PointerRoutedEventArgs, RowColumnIndex)
Processes the row selection when the mouse pointer is pressed in SfTreeGrid.
Declaration
protected abstract 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 SfTreeGrid. The selection is initialized in pointer pressed state when the AllowSelectionOnPointerPressed set as true.
ProcessPointerReleased(PointerRoutedEventArgs, RowColumnIndex)
Processes the row selection when the mouse pointer is released from SfTreeGrid.
Declaration
protected abstract 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 the mouse released point. |
Remarks
The selection is initialized in pointer released state when the AllowSelectionOnPointerPressed set as false.
ProcessSelectedIndexChanged(SelectionPropertyChangedHandlerArgs)
Processes the selection when the SelectedIndex property value changes.
Declaration
protected virtual void ProcessSelectedIndexChanged(SelectionPropertyChangedHandlerArgs handle)
Parameters
Type | Name | Description |
---|---|---|
SelectionPropertyChangedHandlerArgs | handle | The SelectionPropertyChangedHandlerArgs contains the data for the SelectedIndex property value changes. |
ProcessSelectedItemChanged(SelectionPropertyChangedHandlerArgs)
Processes the selection when the SelectedItem property value changes.
Declaration
protected virtual void ProcessSelectedItemChanged(SelectionPropertyChangedHandlerArgs handle)
Parameters
Type | Name | Description |
---|---|---|
SelectionPropertyChangedHandlerArgs | handle | The SelectionPropertyChangedHandlerArgs contains the data for the SelectedItem property value changes. |
ProcessSelectionModeChanged(SelectionPropertyChangedHandlerArgs)
Processes the selection when the SelectionMode property value changes.
Declaration
protected virtual void ProcessSelectionModeChanged(SelectionPropertyChangedHandlerArgs handle)
Parameters
Type | Name | Description |
---|---|---|
SelectionPropertyChangedHandlerArgs | handle | The SelectionPropertyChangedHandlerArgs contains the data for the SelectionMode property changes. |
ResumeUpdates()
Resumes usual selection operation in SfTreeGrid
Declaration
public void ResumeUpdates()
ScrollToRowIndex(Int32)
Scrolls the specified row index to view in SfTreeGrid.
Declaration
protected void ScrollToRowIndex(int rowIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The corresponding row index to scroll the row. |
Remarks
This method helps to scroll the row into view when the row is not present in the view area of SfTreeGrid.
SelectAll()
Selects all the rows in SfTreeGrid.
Declaration
public abstract void SelectAll()
Remarks
This method only works for Multiple and Extended mode selection.
SelectRows(Int32, Int32)
Selects the rows corresponding to the specified start and end index of the row.
Declaration
public abstract void SelectRows(int startRowIndex, int endRowIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | startRowIndex | The start index of the row to select. |
System.Int32 | endRowIndex | The end index of the row to select. |
SetPressedIndex(RowColumnIndex)
Sets the PressedRowColumnIndex of SfTreeGird.
Declaration
protected virtual void SetPressedIndex(RowColumnIndex rowcolumnIndex)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowcolumnIndex | Indicates the starting position of drag selection. |
Remarks
This method helps to initialize the starting position of drag selection.
SuspendUpdates()
Temporarily suspends the updates for the selection operation in SfTreeGrid.
Declaration
public void SuspendUpdates()