Class
RadTreeView

Represents a hierarchical collection of items. Supports expand and collapse, single and multiple selection, item styles and templates. Use the Descriptors property to specify a descriptor for each item type that you want displayed. In the TreeViewDescriptor you must set the TargetType to the corresponding item type.

Definition

Namespace:Telerik.Maui.Controls

Assembly:Telerik.Maui.Controls.dll

Syntax:

cs-api-definition
public class RadTreeView : RadSelectableItemsView, IRadContentView, IContentView, IView, IElement, ITransform, IPadding, ICrossPlatformLayout

Inheritance: objectRadContentViewRadCompositeContentViewRadBorderContentViewRadItemsViewRadSelectableItemsViewRadTreeView

Implements: IContentViewICrossPlatformLayoutIElementIPaddingIRadContentViewITransformIView

Inherited Members RadSelectableItemsView.SelectionModePropertyRadSelectableItemsView.SelectedItemPropertyRadSelectableItemsView.SelectedItemsPropertyRadSelectableItemsView.SelectionModeRadSelectableItemsView.SelectedItemRadSelectableItemsView.SelectedItemsRadSelectableItemsView.SelectionChangedRadItemsView.ItemsSourcePropertyRadItemsView.ItemStylePropertyRadItemsView.ItemStyleSelectorPropertyRadItemsView.ItemTemplatePropertyRadItemsView.EmptyStylePropertyRadItemsView.EmptyTemplatePropertyRadItemsView.IsEmptyPropertyRadItemsView.HorizontalScrollBarStylePropertyRadItemsView.HorizontalScrollBarTemplatePropertyRadItemsView.HorizontalScrollBarVisibilityPropertyRadItemsView.HorizontalScrollBarLayoutModePropertyRadItemsView.VerticalScrollBarStylePropertyRadItemsView.VerticalScrollBarTemplatePropertyRadItemsView.VerticalScrollBarVisibilityPropertyRadItemsView.VerticalScrollBarLayoutModePropertyRadItemsView.ItemTappedCommandPropertyRadItemsView.ItemHoldingCommandPropertyRadItemsView.ScrollTo(object)RadItemsView.OnApplyTemplate()RadItemsView.ItemsSourceRadItemsView.ItemStyleRadItemsView.ItemStyleSelectorRadItemsView.ItemTemplateRadItemsView.EmptyStyleRadItemsView.EmptyTemplateRadItemsView.IsEmptyRadItemsView.HorizontalScrollBarStyleRadItemsView.HorizontalScrollBarTemplateRadItemsView.HorizontalScrollBarVisibilityRadItemsView.HorizontalScrollBarLayoutModeRadItemsView.VerticalScrollBarStyleRadItemsView.VerticalScrollBarTemplateRadItemsView.VerticalScrollBarVisibilityRadItemsView.VerticalScrollBarLayoutModeRadItemsView.ItemTappedCommandRadItemsView.ItemHoldingCommandRadItemsView.ScrollToCommandRadItemsView.ItemsSourceChangedRadItemsView.ItemTappedRadItemsView.ItemHoldingRadBorderContentView.BackgroundColorPropertyRadBorderContentView.BackgroundPropertyRadBorderContentView.BorderColorPropertyRadBorderContentView.BorderBrushPropertyRadBorderContentView.BorderThicknessPropertyRadBorderContentView.CornerRadiusPropertyRadBorderContentView.ContentPaddingPropertyRadBorderContentView.BackgroundColorRadBorderContentView.BackgroundRadBorderContentView.BorderColorRadBorderContentView.BorderBrushRadBorderContentView.BorderThicknessRadBorderContentView.CornerRadiusRadBorderContentView.ContentPaddingRadCompositeContentView.StylePropertyRadCompositeContentView.ControlTemplatePropertyRadCompositeContentView.OnBindingContextChanged()RadCompositeContentView.OnPropertyChanged(string)RadCompositeContentView.StyleRadCompositeContentView.ControlTemplateRadContentView.ActualStyleClassPropertyRadContentView.OnChildAdded(Element)RadContentView.OnChildRemoved(Element, int)RadContentView.OnHandlerChanged()

Constructors

RadTreeView()

Initializes a new instance of the RadTreeView class.

Declaration

cs-api-definition
public RadTreeView()

Fields

CheckBoxModeProperty

Identifies the CheckBoxMode property.

Declaration

cs-api-definition
public static readonly BindableProperty CheckBoxModeProperty

Field Value

BindableProperty

CheckedItemsProperty

Identifies the CheckedItems property.

Declaration

cs-api-definition
public static readonly BindableProperty CheckedItemsProperty

Field Value

BindableProperty

DescriptorsProperty

Identifies the Descriptors property.

Declaration

cs-api-definition
public static readonly BindableProperty DescriptorsProperty

Field Value

BindableProperty

IsLoadChildrenOnDemandEnabledProperty

Identifies the IsLoadChildrenOnDemandEnabled property.

Declaration

cs-api-definition
public static readonly BindableProperty IsLoadChildrenOnDemandEnabledProperty

Field Value

BindableProperty

ItemCheckedCommandProperty

Identifies the ItemCheckedCommand property.

Declaration

cs-api-definition
public static readonly BindableProperty ItemCheckedCommandProperty

Field Value

BindableProperty

ItemCollapsedCommandProperty

Identifies the ItemCollapsedCommand property.

Declaration

cs-api-definition
public static readonly BindableProperty ItemCollapsedCommandProperty

Field Value

BindableProperty

ItemExpandedCommandProperty

Identifies the ItemExpandedCommand property.

Declaration

cs-api-definition
public static readonly BindableProperty ItemExpandedCommandProperty

Field Value

BindableProperty

ItemUncheckedCommandProperty

Identifies the ItemUncheckedCommand property.

Declaration

cs-api-definition
public static readonly BindableProperty ItemUncheckedCommandProperty

Field Value

BindableProperty

LevelIndentationProperty

Identifies the LevelIndentation property.

Declaration

cs-api-definition
public static readonly BindableProperty LevelIndentationProperty

Field Value

BindableProperty

LoadChildrenOnDemandCommandProperty

Identifies the LoadChildrenOnDemandCommand property.

Declaration

cs-api-definition
public static readonly BindableProperty LoadChildrenOnDemandCommandProperty

Field Value

BindableProperty

ScrollOrientationProperty

Identifies the ScrollOrientation property.

Declaration

cs-api-definition
public static readonly BindableProperty ScrollOrientationProperty

Field Value

BindableProperty

Properties

CheckAllCommand

Gets a command to check all items in the control.

Declaration

cs-api-definition
public ICommand CheckAllCommand { get; }

Property Value

ICommand

CheckBoxMode

Gets or sets the mode of the check boxes in the control. For more information see the TreeViewCheckBoxMode type.

Declaration

cs-api-definition
public TreeViewCheckBoxMode CheckBoxMode { get; set; }

Property Value

TreeViewCheckBoxMode

CheckCommand

Gets a command to check a specific item in the control. The command accepts a parameter specifying the path to the item. The path is a collection if unique identifiers of items. The first element of the path identifies an item at the root level. The second element of the path identifies a child of the root item etc. The IdentityMemberPath property can be used to specify the unique identifier at each level of the hierarchy.

Declaration

cs-api-definition
public ICommand CheckCommand { get; }

Property Value

ICommand

CheckedItems

Gets or sets the collection of items, which are currently checked in the control.

Declaration

cs-api-definition
public IList CheckedItems { get; set; }

Property Value

IList

CollapseAllCommand

Gets a command to collapse all items in the control.

Declaration

cs-api-definition
public ICommand CollapseAllCommand { get; }

Property Value

ICommand

CollapseCommand

Gets a command to collapse a specific item in the control. The command accepts a parameter specifying the path to the item. The path is a collection if unique identifiers of items. The first element of the path identifies an item at the root level. The second element of the path identifies a child of the root item etc. The IdentityMemberPath property can be used to specify the unique identifier at each level of the hierarchy.

Declaration

cs-api-definition
public ICommand CollapseCommand { get; }

Property Value

ICommand

Descriptors

Gets or sets a collection of TreeViewDescriptors describing the hierarchical data.

Declaration

cs-api-definition
public IList<TreeViewDescriptor> Descriptors { get; set; }

Property Value

IList<TreeViewDescriptor>

ExpandAllCommand

Gets a command to expand all items in the control.

Declaration

cs-api-definition
public ICommand ExpandAllCommand { get; }

Property Value

ICommand

ExpandCommand

Gets a command to expand a specific item in the control. The command accepts a parameter specifying the path to the item. The path is a collection if unique identifiers of items. The first element of the path identifies an item at the root level. The second element of the path identifies a child of the root item etc. The IdentityMemberPath property can be used to specify the unique identifier at each level of the hierarchy.

Declaration

cs-api-definition
public ICommand ExpandCommand { get; }

Property Value

ICommand

IsLoadChildrenOnDemandEnabled

Gets or sets a value indicating whether load on demand is enabled.

Declaration

cs-api-definition
public bool IsLoadChildrenOnDemandEnabled { get; set; }

Property Value

bool

ItemCheckedCommand

Gets or sets a command to execute when an item is checked after a user interaction. The command should accept a single parameter with the checked item.

Declaration

cs-api-definition
public ICommand ItemCheckedCommand { get; set; }

Property Value

ICommand

ItemCollapsedCommand

Gets or sets a command to execute when an item is collapsed after a user interaction. The command should accept a single parameter with the collapsed item.

Declaration

cs-api-definition
public ICommand ItemCollapsedCommand { get; set; }

Property Value

ICommand

ItemExpandedCommand

Gets or sets a command to execute when an item is expanded after a user interaction. The command should accept a single parameter with the expanded item.

Declaration

cs-api-definition
public ICommand ItemExpandedCommand { get; set; }

Property Value

ICommand

ItemUncheckedCommand

Gets or sets a command to execute when an item is unchecked after a user interaction. The command should accept a single parameter with the unchecked item.

Declaration

cs-api-definition
public ICommand ItemUncheckedCommand { get; set; }

Property Value

ICommand

LevelIndentation

Gets or sets the indentation in pixels between a parent item and its child items.

Declaration

cs-api-definition
public double LevelIndentation { get; set; }

Property Value

double

LoadChildrenOnDemandCommand

Gets or sets a command to execute when loading an item on demand. The command should accept a single parameter of type TreeViewLoadChildrenOnDemandCommandContext.

Declaration

cs-api-definition
public ICommand LoadChildrenOnDemandCommand { get; set; }

Property Value

ICommand

ScrollOrientation

Gets or sets the current scroll orientation of the control. Form ore information see the TreeViewScrollOrientation type.

Declaration

cs-api-definition
public TreeViewScrollOrientation ScrollOrientation { get; set; }

Property Value

TreeViewScrollOrientation

UncheckAllCommand

Gets a command to uncheck all items in the control.

Declaration

cs-api-definition
public ICommand UncheckAllCommand { get; }

Property Value

ICommand

UncheckCommand

Gets a command to uncheck a specific item in the control. The command accepts a parameter specifying the path to the item. The path is a collection if unique identifiers of items. The first element of the path identifies an item at the root level. The second element of the path identifies a child of the root item etc. The IdentityMemberPath property can be used to specify the unique identifier at each level of the hierarchy.

Declaration

cs-api-definition
public ICommand UncheckCommand { get; }

Property Value

ICommand

Methods

Check(IEnumerable)

Checks the item in hierarchy with the specified path.

Declaration

cs-api-definition
public bool Check(IEnumerable itemPath)

Parameters

itemPath

IEnumerable

Specifies the path to an item in the hierarchy to checked. The path is a collection if unique identifiers of items. The first element of the path identifies an item at the root level. The second element of the path identifies a child of the root item etc. The IdentityMemberPath property can be used to specify the unique identifier at each level of the hierarchy.

Returns

bool

true if the item was found and checked successfully, false otherwise.

Check(params object[])

Checks the item in hierarchy with the specified path.

Declaration

cs-api-definition
public bool Check(params object[] itemPath)

Parameters

itemPath

object[]

Specifies the path to an item in the hierarchy to checked. The path is a collection if unique identifiers of items. The first element of the path identifies an item at the root level. The second element of the path identifies a child of the root item etc. The IdentityMemberPath property can be used to specify the unique identifier at each level of the hierarchy.

Returns

bool

true if the item was found and checked successfully, false otherwise.

CheckAll()

Checks all items in the control.

Declaration

cs-api-definition
public void CheckAll()

Collapse(IEnumerable)

Collapses the item in hierarchy with the specified path.

Declaration

cs-api-definition
public bool Collapse(IEnumerable itemPath)

Parameters

itemPath

IEnumerable

Specifies the path to an item in the hierarchy to collapse. The path is a collection if unique identifiers of items. The first element of the path identifies an item at the root level. The second element of the path identifies a child of the root item etc. The IdentityMemberPath property can be used to specify the unique identifier at each level of the hierarchy.

Returns

bool

true if the item was found and collapsed successfully, false otherwise.

Collapse(params object[])

Collapses the item in hierarchy with the specified path.

Declaration

cs-api-definition
public bool Collapse(params object[] itemPath)

Parameters

itemPath

object[]

Specifies the path to an item in the hierarchy to collapse. The path is a collection if unique identifiers of items. The first element of the path identifies an item at the root level. The second element of the path identifies a child of the root item etc. The IdentityMemberPath property can be used to specify the unique identifier at each level of the hierarchy.

Returns

bool

true if the item was found and collapsed successfully, false otherwise.

CollapseAll()

Collapses all items in the control.

Declaration

cs-api-definition
public void CollapseAll()

Expand(IEnumerable)

Expands the item in hierarchy with the specified path.

Declaration

cs-api-definition
public bool Expand(IEnumerable itemPath)

Parameters

itemPath

IEnumerable

Specifies the path to an item in the hierarchy to expand. The path is a collection if unique identifiers of items. The first element of the path identifies an item at the root level. The second element of the path identifies a child of the root item etc. The IdentityMemberPath property can be used to specify the unique identifier at each level of the hierarchy.

Returns

bool

true if the item was found and expanded successfully, false otherwise.

Expand(params object[])

Expands the item in hierarchy with the specified path.

Declaration

cs-api-definition
public bool Expand(params object[] itemPath)

Parameters

itemPath

object[]

Specifies the path to an item in the hierarchy to expand. The path is a collection if unique identifiers of items. The first element of the path identifies an item at the root level. The second element of the path identifies a child of the root item etc. The IdentityMemberPath property can be used to specify the unique identifier at each level of the hierarchy.

Returns

bool

true if the item was found and expanded successfully, false otherwise.

ExpandAll()

Expands all items in the control.

Declaration

cs-api-definition
public void ExpandAll()

Uncheck(IEnumerable)

Unchecks the item in hierarchy with the specified path.

Declaration

cs-api-definition
public bool Uncheck(IEnumerable itemPath)

Parameters

itemPath

IEnumerable

Specifies the path to an item in the hierarchy to unchecked. The path is a collection if unique identifiers of items. The first element of the path identifies an item at the root level. The second element of the path identifies a child of the root item etc. The IdentityMemberPath property can be used to specify the unique identifier at each level of the hierarchy.

Returns

bool

true if the item was found and unchecked successfully, false otherwise.

Uncheck(params object[])

Unchecks the item in hierarchy with the specified path.

Declaration

cs-api-definition
public bool Uncheck(params object[] itemPath)

Parameters

itemPath

object[]

Specifies the path to an item in the hierarchy to unchecked. The path is a collection if unique identifiers of items. The first element of the path identifies an item at the root level. The second element of the path identifies a child of the root item etc. The IdentityMemberPath property can be used to specify the unique identifier at each level of the hierarchy.

Returns

bool

true if the item was found and unchecked successfully, false otherwise.

UncheckAll()

Unchecks all items in the control.

Declaration

cs-api-definition
public void UncheckAll()

Events

ItemChecked

Raised when an item is checked after a user interaction. For more information see the TreeViewItemViewInteractionEventArgs type.

Declaration

cs-api-definition
public event EventHandler<TreeViewItemViewInteractionEventArgs> ItemChecked

Event Value

EventHandler<TreeViewItemViewInteractionEventArgs>

ItemCollapsed

Raised when an item is collapsed after a user interaction. For more information see the TreeViewItemViewInteractionEventArgs type.

Declaration

cs-api-definition
public event EventHandler<TreeViewItemViewInteractionEventArgs> ItemCollapsed

Event Value

EventHandler<TreeViewItemViewInteractionEventArgs>

ItemExpanded

Raised when an item is expanded after a user interaction. For more information see the TreeViewItemViewInteractionEventArgs type.

Declaration

cs-api-definition
public event EventHandler<TreeViewItemViewInteractionEventArgs> ItemExpanded

Event Value

EventHandler<TreeViewItemViewInteractionEventArgs>

ItemUnchecked

Raised when an item is unchecked after a user interaction. For more information see the TreeViewItemViewInteractionEventArgs type.

Declaration

cs-api-definition
public event EventHandler<TreeViewItemViewInteractionEventArgs> ItemUnchecked

Event Value

EventHandler<TreeViewItemViewInteractionEventArgs>

LoadChildrenOnDemand

Raised when loading an item on demand. For more information see the TreeViewLoadChildrenOnDemandEventArgs type.

Declaration

cs-api-definition
public event EventHandler<TreeViewLoadChildrenOnDemandEventArgs> LoadChildrenOnDemand

Event Value

EventHandler<TreeViewLoadChildrenOnDemandEventArgs>