ITreeDataGridSelectionInteraction Interface
Definition
Defines the interaction between a Avalonia.Controls.TreeDataGrid and an Avalonia.Controls.Selection.TreeDataGridSelectionModel model.
public interface ITreeDataGridSelectionInteraction
Remarks
This interface is implemented by selection models to handle user interactions with the TreeDataGrid, such as keyboard navigation, pointer events, and selection state changes. It provides the connection between user input and the actual selection behavior.
This interface is experimental: it is exposed to allow custom selection models to be implemented, but it may be changed or removed in a future release.
Methods
| Name | Description |
|---|---|
| IsCellSelected | Determines whether a specific cell is selected. |
| IsRowSelected (2 overloads) | Determines whether a specific row model is selected. |
| OnKeyDown | Handles the KeyDown event from the TreeDataGrid. |
| OnKeyUp | Handles the KeyUp event from the TreeDataGrid. |
| OnPointerMoved | Handles the PointerMoved event from the TreeDataGrid. |
| OnPointerPressed | Handles the PointerPressed event from the TreeDataGrid. |
| OnPointerReleased | Handles the PointerReleased event from the TreeDataGrid. |
| OnPreviewKeyDown | Handles the PreviewKeyDown event from the TreeDataGrid. |
| OnTextInput | Handles the TextInput event from the TreeDataGrid. |
IsCellSelected Method
Determines whether a specific cell is selected.
public bool IsCellSelected(int columnIndex, int rowIndex)
Parameters
columnIndex int
The index of the column.
rowIndex int
The index of the row.
Returns
bool
true if the cell is selected; otherwise, false.
Remarks
This method is used by the TreeDataGrid to determine whether to display a cell with the selected visual state.
IsRowSelected overloads
IsRowSelected Method
Determines whether a specific row model is selected.
public bool IsRowSelected(Avalonia.Controls.Models.ITreeDataGridRowModel rowModel)
Parameters
rowModel Avalonia.Controls.Models.ITreeDataGridRowModel
The row model to check.
Returns
bool
true if the row is selected; otherwise, false.
Remarks
This method is used by the TreeDataGrid to determine whether to display a row with the selected visual state.
IsRowSelected Method
Determines whether a specific row is selected.
public bool IsRowSelected(int rowIndex)
Parameters
rowIndex int
The index of the row to check.
Returns
bool
true if the row is selected; otherwise, false.
Remarks
This method is used by the TreeDataGrid to determine whether to display a row with the selected visual state.