Skip to main content

ITreeDataGridRowSelection Interface

Definition

Assembly:Avalonia.Controls.TreeDataGrid
Package:Avalonia.Controls.TreeDataGrid

Provides non-generic access to row selection state.

public interface ITreeDataGridRowSelection

Remarks

Avalonia.Controls.Selection.TreeDataGridRowSelectionModel<T> is generic, but the Avalonia.Controls.TreeDataGrid and its automation peers need non-generic access to the row selection state. Custom row selection models should implement this interface in order to expose their selection to UI Automation clients such as screen readers, and to support row drag/drop.

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

NameDescription
DeselectRemoves the item at the specified index from the selection.
IsSelectedDetermines whether the item at the specified index is selected.
SelectAdds the item at the specified index to the selection.

Deselect Method

Removes the item at the specified index from the selection.

public void Deselect(Avalonia.Controls.IndexPath index)

Parameters

index Avalonia.Controls.IndexPath

The index of the item to deselect.

IsSelected Method

Determines whether the item at the specified index is selected.

public bool IsSelected(Avalonia.Controls.IndexPath index)

Parameters

index Avalonia.Controls.IndexPath

The index of the item in the source data.

Returns

bool

true if the item is selected; otherwise false.

Select Method

Adds the item at the specified index to the selection.

public void Select(Avalonia.Controls.IndexPath index)

Parameters

index Avalonia.Controls.IndexPath

The index of the item to select.

Properties

NameDescription
CountGets the number of selected items.
SelectedIndexGets or sets the selected index. Setting this value clears the existing selection and selects the single specified item.
SelectedIndexesGets the indexes of the selected items.
SelectedItemsGets the selected items as an untyped list.

Count Property

Gets the number of selected items.

public int Count { get; set; }

SelectedIndex Property

Gets or sets the selected index. Setting this value clears the existing selection and selects the single specified item.

public Avalonia.Controls.IndexPath SelectedIndex { get; set; }

SelectedIndexes Property

Gets the indexes of the selected items.

public System.Collections.Generic.IReadOnlyList<Avalonia.Controls.IndexPath> SelectedIndexes { get; set; }

SelectedItems Property

Gets the selected items as an untyped list.

public System.Collections.Generic.IReadOnlyList<object> SelectedItems { get; set; }