Skip to main content

Creating a Custom Detail Description

The following example demonstrates how to create and use a custom detail description that handles LINQ detail relations, which are provided by properties to which the AssociationAttribute is applied.

  <Grid>
<Grid.Resources>
<xcdg:DataGridCollectionViewSource x:Key="cvs_employees"
Source="{Binding Source={x:Static Application.Current},
Path=LinqDataContext.Employees}">
<xcdg:DataGridCollectionViewSource.DetailDescriptions>
<local:LinqToSqlDetailDescription RelationName="Employee_Employees"
Title="Employees" />
<local:LinqToSqlDetailDescription RelationName="Employee_Customer"
Title="Customers">
<local:LinqToSqlDetailDescription.DetailDescriptions>
<local:LinqToSqlDetailDescription RelationName="Customer_Order"
Title="Orders">
<local:LinqToSqlDetailDescription.DetailDescriptions>
<local:LinqToSqlDetailDescription RelationName="Order_Order_Detail"
Title="Order Details" />
</local:LinqToSqlDetailDescription.DetailDescriptions>
</local:LinqToSqlDetailDescription>
</local:LinqToSqlDetailDescription.DetailDescriptions>
</local:LinqToSqlDetailDescription>
</xcdg:DataGridCollectionViewSource.DetailDescriptions>
</xcdg:DataGridCollectionViewSource>
</Grid.Resources>

<xcdg:DataGridControl x:Name="EmployeesGrid"
ItemsSource="{Binding Source={StaticResource cvs_employees}}"
ItemsSourceName="Employee Information"
AutoCreateDetailConfigurations="True" />
</Grid>