Skip to main content

DXTreeView.ItemTemplate Property

Gets or sets the DXTreeView item template. This is a bindable property.

Namespace: DevExpress.Maui.TreeView

Assembly: DevExpress.Maui.TreeView.dll

NuGet Package: DevExpress.Maui.TreeView

Declaration

public DataTemplate ItemTemplate { get; set; }

Property Value

Type Description
DataTemplate

The DXTreeView item template.

Remarks

The following code snippet uses the ItemTemplate property to customize DXTreeView data items:

DevExpress Tree View for MAUI - Item Template

<dxt:DXTreeView  x:Name="treeView" ... >
    <dxt:DXTreeView.ItemTemplate>
        <DataTemplate x:Key="nodeTemplate">
            <dxt:TreeNodeView AllowExpandButton="False">
                <dx:DXDockLayout HorizontalSpacing="12">
                    <dxt:TreeNodeExpandButton 
                        dx:DXDockLayout.Dock="Right" 
                        ContentRotation="-90" 
                        CheckedContentRotation="90"
                        AnimationDuration="0:0:0.250"/>
                    <dx:DXImage 
                        dx:DXDockLayout.Dock="Left" 
                        Source="{Binding Item.Image}" 
                        WidthRequest="40" HeightRequest="40">
                        <Image.Clip>
                            <EllipseGeometry RadiusX="20" RadiusY="20" Center="20, 20" />
                        </Image.Clip>
                    </dx:DXImage>
                    <dx:DXStackLayout 
                        Orientation="Vertical" 
                        VerticalOptions="Center" 
                        Margin="0,0,16,0">
                        <Label
                            Text="{Binding Item.JobTitle}"
                            ... />
                        <Label 
                            dx:DXDockLayout.Dock="Right"
                            ... >
                            <Label.FormattedText>
                                <FormattedString>
                                    ...
                                </FormattedString>
                            </Label.FormattedText>
                        </Label>
                    </dx:DXStackLayout>
                </dx:DXDockLayout>
            </dxt:TreeNodeView>
        </DataTemplate>
    </dxt:DXTreeView.ItemTemplate>
</dxt:DXTreeView>

For more information, refer to the following help topic: Change Item Template.

See Also