Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

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