DetailDescriptions Property (DataGridDetailDescription)
Gets a collection of
DataGridDetailDescription objects that provide information on the details that will be contained in the detail, including sorting, grouping, and child detail descriptions.
Property Value
A
DataGridDetailDescriptionCollection that contains
DataGridDetailDescription objects that provide information on the details that will be contained in the grid, including sorting, grouping, and child detail descriptions.
All examples in this topic assume that the grid is bound to the
Employees table of the Northwind database, unless stated otherwise
The following example demonstrates how to explicitly define detail descriptions for the DataRelations found in the DataTable to which the grid is bound and how to calculate statistical functions for a detail description whose results will be displayed in the StatRows contained in the footer sections of the details to which the description's corresponding detail configuration will be applied.
<Grid>
<Grid.Resources>
<xcdg:DataGridCollectionViewSource x:Key="cvs_employees"
Source="{Binding Source={x:Static Application.Current},
Path=Employees}">
<xcdg:DataGridCollectionViewSource.DetailDescriptions>
<xcdg:DataRelationDetailDescription RelationName="Employee_Orders"
Title="Employee Orders">
<xcdg:DataRelationDetailDescription.DetailDescriptions>
<xcdg:DataRelationDetailDescription RelationName="Order_OrderDetails"
Title="Order Details">
<xcdg:DataRelationDetailDescription.ItemProperties>
<xcdg:DataGridItemProperty Name="UnitPrice" />
<xcdg:DataGridItemProperty Name="Quantity" />
<xcdg:DataGridItemProperty Name="Discount" />
</xcdg:DataRelationDetailDescription.ItemProperties>
<xcdg:DataRelationDetailDescription.StatFunctions>
<xcdg:SumFunction ResultPropertyName="sum_quantity"
SourcePropertyName="Quantity" />
<xcdg:AverageFunction ResultPropertyName="average_unitprice"
SourcePropertyName="UnitPrice" />
</xcdg:DataRelationDetailDescription.StatFunctions>
</xcdg:DataRelationDetailDescription>
</xcdg:DataRelationDetailDescription.DetailDescriptions>
</xcdg:DataRelationDetailDescription>
</xcdg:DataGridCollectionViewSource.DetailDescriptions>
</xcdg:DataGridCollectionViewSource>
</Grid.Resources>
<xcdg:DataGridControl x:Name="EmployeesGrid"
ItemsSource="{Binding Source={StaticResource cvs_employees}}"
ItemsSourceName="Employee Information"
AutoCreateDetailConfigurations="True">
<xcdg:DataGridControl.DetailConfigurations>
<xcdg:DetailConfiguration RelationName="Employee_Orders">
<xcdg:DetailConfiguration.DetailConfigurations>
<xcdg:DetailConfiguration RelationName="Order_OrderDetails">
<xcdg:DetailConfiguration.Footers>
<DataTemplate>
<xcdg:StatRow Background="AliceBlue">
<xcdg:StatCell FieldName="UnitPrice"
ResultPropertyName="average_unitprice"
ResultConverterParameter="f2" />
<xcdg:StatCell FieldName="Quantity"
ResultPropertyName="sum_quantity" />
</xcdg:StatRow>
</DataTemplate>
</xcdg:DetailConfiguration.Footers>
</xcdg:DetailConfiguration>
</xcdg:DetailConfiguration.DetailConfigurations>
</xcdg:DetailConfiguration>
</xcdg:DataGridControl.DetailConfigurations>
</xcdg:DataGridControl>
</Grid>
.NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.
.NET Framework: net20, net35, net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.