menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class TreeGridBaseSelectionController - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class TreeGridBaseSelectionController

    Provides the base implementation for selection in SfTreeGrid.

    Inheritance
    System.Object
    TreeGridBaseSelectionController
    TreeGridRowSelectionController
    Implements
    ITreeGridSelectionController
    System.IDisposable
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.UI.Xaml.TreeGrid
    Assembly: Syncfusion.SfGrid.WPF.dll
    Syntax
    public abstract class TreeGridBaseSelectionController : 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.

    Fields

    LastPressedKey

    Gets or sets the last pressed key.

    Declaration
    protected Key LastPressedKey
    Field Value
    Type
    System.Windows.Input.Key

    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 Key)

    Changes the flow direction of key navigation based on the Windows.UI.Xaml.FlowDirection in SfTreeGrid.

    Declaration
    protected void ChangeFlowDirectionKey(ref Key currentKey)
    Parameters
    Type Name Description
    System.Windows.Input.Key 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(KeyEventArgs)

    Handles the selection for the keyboard interactions that are performed in SfTreeGrid.

    Declaration
    public abstract 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 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(MouseButtonEventArgs, RowColumnIndex)

    Processes the cell selection when the mouse point is tapped on the grid cell.

    Declaration
    protected abstract void ProcessOnTapped(MouseButtonEventArgs e, RowColumnIndex currentRowColumnIndex)
    Parameters
    Type Name Description
    System.Windows.Input.MouseButtonEventArgs 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(MouseEventArgs, RowColumnIndex)

    Processes the row selection when mouse pointer is moved on the SfTreeGrid.

    Declaration
    protected abstract void ProcessPointerMoved(MouseEventArgs args, RowColumnIndex rowColumnIndex)
    Parameters
    Type Name Description
    System.Windows.Input.MouseEventArgs args

    Contains the data for mouse related interaction.

    RowColumnIndex rowColumnIndex

    The corresponding rowColumnIndex related to the mouse point.

    ProcessPointerPressed(MouseButtonEventArgs, RowColumnIndex)

    Processes the row selection when the mouse pointer is pressed in SfTreeGrid.

    Declaration
    protected abstract void ProcessPointerPressed(MouseButtonEventArgs args, RowColumnIndex rowColumnIndex)
    Parameters
    Type Name Description
    System.Windows.Input.MouseButtonEventArgs 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(MouseButtonEventArgs, RowColumnIndex)

    Processes the row selection when the mouse pointer is released from SfTreeGrid.

    Declaration
    protected abstract void ProcessPointerReleased(MouseButtonEventArgs args, RowColumnIndex rowColumnIndex)
    Parameters
    Type Name Description
    System.Windows.Input.MouseButtonEventArgs 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.

    ProcessPointerWheel(MouseWheelEventArgs, RowColumnIndex)

    Processes the cell selection while scrolling the SfTreeGrid using mouse wheel.

    Declaration
    protected abstract void ProcessPointerWheel(MouseWheelEventArgs args, RowColumnIndex rowColumnIndex)
    Parameters
    Type Name Description
    System.Windows.Input.MouseWheelEventArgs args
    RowColumnIndex rowColumnIndex

    The corresponding rowColumnIndex where the mouse wheel interaction occurs.

    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.

    RaiseSelectionChanged(List<Object>, List<Object>)

    Raises the SelectionChanged event.

    Declaration
    protected void RaiseSelectionChanged(List<object> addedItems, List<object> removedItems)
    Parameters
    Type Name Description
    System.Collections.Generic.List<System.Object> addedItems

    Contains the items that were selected.

    System.Collections.Generic.List<System.Object> removedItems

    Contains the items that were unselected.

    RaiseSelectionChanging(List<Object>, List<Object>)

    Raises the SelectionChanging event in SfTreeGrid.

    Declaration
    protected bool RaiseSelectionChanging(List<object> addedItems, List<object> removedItems)
    Parameters
    Type Name Description
    System.Collections.Generic.List<System.Object> addedItems

    Contains the items that were selected.

    System.Collections.Generic.List<System.Object> removedItems

    Contains the items that were unselected.

    Returns
    Type Description
    System.Boolean

    Returns true if the SelectionChanging is raised; otherwise, false.

    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()

    Implements

    ITreeGridSelectionController
    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved