Represents a table-view layout similar to TableflowView, in which rows are laid out horizontally as in traditional grid-like styles, but detail columns are aligned with the columns of the master, and one column displays data using a tree-structure.
Like TableflowView, it provides animated smooth scrolling, sticky group headers and sticky master-detail master row and headers, full-column animated drag and drop reordering. (See limitations below.)
All examples in this topic assume that the grid is bound to the
Employees table of the Northwind database, unless stated otherwise.
The following demonstrates how to set up a TreeGridflowView.
<xcdg:DataGridControl x:Name="grid"
ItemsSource="{Binding Source={StaticResource cvsEmployees}}"
FlowDirection="{Binding Source={x:Static local:ConfigurationData.Singleton}, Path=FlowDirection}"
ReadOnly="True">
<xcdg:DataGridControl.Columns>
<xcdg:Column FieldName="Photo"
IsMainColumn="True" />
<xcdg:Column FieldName="FirstName" />
<xcdg:Column FieldName="LastName" />
<xcdg:Column FieldName="Title" />
<xcdg:Column FieldName="HireDate"
CellContentTemplate="{StaticResource shortDateCellDataTemplate}" />
<xcdg:Column FieldName="BirthDate"
CellContentTemplate="{StaticResource shortDateCellDataTemplate}" />
<xcdg:Column FieldName="Country"
CellContentTemplate="{StaticResource countryCellContentTemplate}" />
<!-- The other columns will be added after these ones and will have default
appearance and behavior when they are automatically added upon loading. -->
</xcdg:DataGridControl.Columns>
<xcdg:DataGridControl.DetailConfigurations>
<xcdg:DetailConfiguration RelationName="SubEmployees"
AutoCreateDetailConfigurations="False">
<xcdg:DetailConfiguration.Columns>
<xcdg:Column FieldName="HireDate"
CellContentTemplate="{StaticResource shortDateCellDataTemplate}" />
<xcdg:Column FieldName="BirthDate"
CellContentTemplate="{StaticResource shortDateCellDataTemplate}" />
<xcdg:Column FieldName="Country"
CellContentTemplate="{StaticResource countryCellContentTemplate}" />
</xcdg:DetailConfiguration.Columns>
<xcdg:DetailConfiguration.DetailConfigurations>
<xcdg:DetailConfiguration RelationName="SubEmployees"
AutoCreateDetailConfigurations="False">
<xcdg:DetailConfiguration.Columns>
<xcdg:Column FieldName="HireDate"
CellContentTemplate="{StaticResource shortDateCellDataTemplate}" />
<xcdg:Column FieldName="BirthDate"
CellContentTemplate="{StaticResource shortDateCellDataTemplate}" />
<xcdg:Column FieldName="Country"
CellContentTemplate="{StaticResource countryCellContentTemplate}" />
</xcdg:DetailConfiguration.Columns>
</xcdg:DetailConfiguration>
</xcdg:DetailConfiguration.DetailConfigurations>
</xcdg:DetailConfiguration>
</xcdg:DataGridControl.DetailConfigurations>
<xcdg:DataGridControl.View>
<!-- In this sample, you can define this resource to specify the default
theme this DataGridControl will be in. This is not mandatory, so we
use a DynamicResource to silently ignore its absence. -->
<xcdg:TreeGridflowView Theme="{DynamicResource defaultTheme}"
UseDefaultHeadersFooters="False"
ShowFixedColumnSplitter="{Binding Source={x:Static local:ConfigurationData.Singleton}, Path=ShowFixedColumnSplitter}"
IsAlternatingRowStyleEnabled="{Binding Source={x:Static local:ConfigurationData.Singleton}, Path=IsAlternatingRowStyleEnabled}" />
</xcdg:DataGridControl.View>
</xcdg:DataGridControl>
Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2