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

Migrating the TreeView from Xamarin.Forms to .NET MAUI

The Telerik UI for .NET MAUI TreeView control has been designed and built from the ground up as a new control with a new API and significant improvements over its Xamarin counterpart.

The tables in the following sections list the differences between the APIs of the Xamarin.Forms TreeView and .NET MAUI TreeView.

Namespaces Differences

When migrating the TreeView from Xamarin to .NET MAUI, consider the following differences in the namespaces:

ControlControl nameXAML NamespcaceC# Namespace
Xamarin TreeViewRadTreeViewxmlns:telerikDataControls="clr-namespace:Telerik.XamarinForms.DataControls;assembly=Telerik.XamarinForms.DataControls"using Telerik.XamarinForms.DataControls;
.NET MAUI TreeViewRadTreeViewxmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"`using Telerik.Maui.Controls;

API Differences

When migrating the TreeView from Xamarin to .NET MAUI, consider the following differences in the API:

Xamarin TreeView.NET MAUI TreeView
N/AHorizontalScrollBarVisibility
N/AHorizontalScrollBarLayoutMode
N/AVerticalScrollBarVisibility
N/AVerticalScrollBarLayoutMode
SelectedItems Collection(read-only)SelectedItems Collection
N/ASelectedItem
N/ASelectionMode - None, Single, Multiple
CheckedItemsCollection(read-only)CheckedItemsCollection
CheckBoxModes- None, Individual (independent), Propagate (recursive)CheckBoxModes - None,Independent,Recursive
ItemTemplate (applies on TreeViewDescriptor level)ItemTemplate (applies on TreeView level), ItemTemplate (applies on TreeViewDescriptor level)
ScrollItemIntoView()ScrollTo()
N/AItemsSourceChanged event
SelectionChangedSelectionChanged event
ItemTapped eventItemTapped event
ItemHold eventItemHolding event
ItemCollapsed eventItemCollapsed event
ItemExpanded eventItemExpanded event
N/AItemChecked event
N/AItemUnchecked event
N/ALoadChildrenOnDemand event
ItemTap commandItemTappedCommand
ItemHold commandItemHoldingCommand
ItemCollapse commandItemCollapsedCommand
ItemExpand commandItemExpandedCommand
LoadOnDemand commandLoadChildrenOnDemandCommand
N/AExpandAllCommand
N/ACollapseAllCommand
N/AExpandCommand
N/ACollapseCommand
N/ACheckAllCommand
N/AUncheckAllCommand
N/AUncheckCommand
N/ACheckCommand
N/AScrollToCommand
N/AItemCheckedCommand
N/AItemUncheckedCommand
ExpandAll()ExpandAll()
ExpandAll()CollapseAll()
Expand()Expand()
Collapse()Collapse()
N/ACheckAlll()
N/AUnCheckAll()
CheckItem()Check()
UncheckItem()Uncheck()
ItemStyle (applies on TreeView level)ItemStyle (applies on TreeView level), ItemStyle (applies on TreeViewDescriptor level)
ItemStyleSelector (applies on TreeView level)ItemStyleSelector (applies on TreeView level), ItemStyleSelector (applies on TreeViewDescriptor level)

See Also