Articles in this section

How to display the image and text in WPF TreeGrid (SfTreeGrid) column ?

WPF TreeGrid (SfTreeGrid) allows you to display image and text in the columns by using TreeGridTemplateColumn.

<syncfusion:TreeGridTemplateColumn MappingName="FirstName">
    <syncfusion:TreeGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <StackPanel Orientation="Horizontal">
                <Image Source="Employee.png" HorizontalAlignment="Left"  Margin="5" VerticalAlignment="Center"/>
                <TextBlock Text="{Binding FirstName}"/>
            </StackPanel>
        </DataTemplate>
    </syncfusion:TreeGridTemplateColumn.CellTemplate>
    <syncfusion:TreeGridTemplateColumn.EditTemplate>
        <DataTemplate>
            <StackPanel Orientation="Horizontal">
                <Image Source="Employee.png" HorizontalAlignment="Left"  Margin="5" VerticalAlignment="Center"/>
                <TextBox Text="{Binding FirstName, Mode=TwoWay}"/>
            </StackPanel>
        </DataTemplate>
    </syncfusion:TreeGridTemplateColumn.EditTemplate>
</syncfusion:TreeGridTemplateColumn> 

 

Image and  text column

Take a moment to peruse the documentation, where you can find about template column support in SfTreeGrid, with code examples.

View sample in GitHub

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied