New to Telerik UI for .NET MAUIStart a free 30-day trial

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:

C#
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

Initializes a new instance of the RadTreeView class.

C#
public RadTreeView()

Fields

CheckBoxModeProperty

BindableProperty

Identifies the CheckBoxMode property.

C#
public static readonly BindableProperty CheckBoxModeProperty

CheckedItemsProperty

BindableProperty

Identifies the CheckedItems property.

C#
public static readonly BindableProperty CheckedItemsProperty

DescriptorsProperty

BindableProperty

Identifies the Descriptors property.

C#
public static readonly BindableProperty DescriptorsProperty

Identifies the IsLoadChildrenOnDemandEnabled property.

C#
public static readonly BindableProperty IsLoadChildrenOnDemandEnabledProperty

Identifies the ItemCheckedCommand property.

C#
public static readonly BindableProperty ItemCheckedCommandProperty

Identifies the ItemCollapsedCommand property.

C#
public static readonly BindableProperty ItemCollapsedCommandProperty

Identifies the ItemExpandedCommand property.

C#
public static readonly BindableProperty ItemExpandedCommandProperty

Identifies the ItemUncheckedCommand property.

C#
public static readonly BindableProperty ItemUncheckedCommandProperty

LevelIndentationProperty

BindableProperty

Identifies the LevelIndentation property.

C#
public static readonly BindableProperty LevelIndentationProperty

Identifies the LoadChildrenOnDemandCommand property.

C#
public static readonly BindableProperty LoadChildrenOnDemandCommandProperty

Identifies the ScrollOrientation property.

C#
public static readonly BindableProperty ScrollOrientationProperty

Properties

Gets a command to check all items in the control.

C#
public ICommand CheckAllCommand { get; }

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

C#
public TreeViewCheckBoxMode CheckBoxMode { get; set; }

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.

C#
public ICommand CheckCommand { get; }

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

C#
public IList CheckedItems { get; set; }

Gets a command to collapse all items in the control.

C#
public ICommand CollapseAllCommand { get; }

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.

C#
public ICommand CollapseCommand { get; }

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

C#
public IList<TreeViewDescriptor> Descriptors { get; set; }

Gets a command to expand all items in the control.

C#
public ICommand ExpandAllCommand { get; }

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.

C#
public ICommand ExpandCommand { get; }

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

C#
public bool IsLoadChildrenOnDemandEnabled { get; set; }

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.

C#
public ICommand ItemCheckedCommand { get; set; }

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.

C#
public ICommand ItemCollapsedCommand { get; set; }

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.

C#
public ICommand ItemExpandedCommand { get; set; }

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.

C#
public ICommand ItemUncheckedCommand { get; set; }

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

C#
public double LevelIndentation { get; set; }

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

C#
public ICommand LoadChildrenOnDemandCommand { get; set; }

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

C#
public TreeViewScrollOrientation ScrollOrientation { get; set; }

Gets a command to uncheck all items in the control.

C#
public ICommand UncheckAllCommand { get; }

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.

C#
public ICommand UncheckCommand { get; }

Methods

Checks the item in hierarchy with the specified path.

C#
public bool Check(IEnumerable itemPath)
Parameters:itemPathIEnumerable

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.

Checks the item in hierarchy with the specified path.

C#
public bool Check(params object[] itemPath)
Parameters:itemPathobject[]

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.

Checks all items in the control.

C#
public void CheckAll()

Collapses the item in hierarchy with the specified path.

C#
public bool Collapse(IEnumerable itemPath)
Parameters:itemPathIEnumerable

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.

Collapses the item in hierarchy with the specified path.

C#
public bool Collapse(params object[] itemPath)
Parameters:itemPathobject[]

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.

Collapses all items in the control.

C#
public void CollapseAll()

Expands the item in hierarchy with the specified path.

C#
public bool Expand(IEnumerable itemPath)
Parameters:itemPathIEnumerable

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.

Expands the item in hierarchy with the specified path.

C#
public bool Expand(params object[] itemPath)
Parameters:itemPathobject[]

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.

Expands all items in the control.

C#
public void ExpandAll()

Unchecks the item in hierarchy with the specified path.

C#
public bool Uncheck(IEnumerable itemPath)
Parameters:itemPathIEnumerable

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.

Unchecks the item in hierarchy with the specified path.

C#
public bool Uncheck(params object[] itemPath)
Parameters:itemPathobject[]

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.

Unchecks all items in the control.

C#
public void UncheckAll()

Events

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

C#
public event EventHandler<TreeViewItemViewInteractionEventArgs> ItemChecked

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

C#
public event EventHandler<TreeViewItemViewInteractionEventArgs> ItemCollapsed

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

C#
public event EventHandler<TreeViewItemViewInteractionEventArgs> ItemExpanded

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

C#
public event EventHandler<TreeViewItemViewInteractionEventArgs> ItemUnchecked

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

C#
public event EventHandler<TreeViewLoadChildrenOnDemandEventArgs> LoadChildrenOnDemand