ContentDetailDescriptor Class

Represents a Detail with freely-customizable content.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v21.2.Core.dll


public class ContentDetailDescriptor :


When setting up master-detail hierarchy, the Detail may display either another grid or custom controls. If you choose to display custom controls, you will need to use the ContentDetailDescriptor object in one of the following ways:

The following are the main members in the ContentDetailDescriptor class that you will need to work with:

Member Description
DetailDescriptorBase.ContentTemplate Gets or sets the template specifying the entire or partial content of a Detail.
ContentDetailDescriptor.HeaderContent Gets or sets the detail section’s header content. This is a dependency property.

This example shows how to setup a GridControl detail with a memo field. Thus, you will see ContentDetailDescriptor objects in action.

The form first displays one grid that has been set up via XAML code. There’s also a button that created a second identical grid in code, so you can learn both ways to add details to the grid.

View Example

<Window xmlns:dxg=""  x:Class="WpfApplication18.MainWindow"
        Title="MainWindow" Height="768" Width="1024" xmlns:my="clr-namespace:WpfApplication18" Loaded="Window_Loaded">
        <!--<DataTemplate x:Key="EmployeeNotes">
                <TextBlock Text="{Binding Path=Notes}" TextWrapping="Wrap" ></TextBlock>
    <Grid x:Name="mainGrid">
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="32"/>
        <!--region #GridDesignTime-->
        <dxg:GridControl Grid.Row="0" Name="gridControl1" AutoGenerateColumns="AddNew" >
                <dxg:TableView DetailHeaderContent="Employees" AutoWidth="True" ShowGroupPanel="False"  />
                <dxg:ContentDetailDescriptor  HeaderContent="Notes">
                        <DataTemplate >
                                <TextBlock Text="{Binding Path=Notes}" TextWrapping="Wrap" ></TextBlock>
        <!--endregion #GridDesignTime-->

        <Button Grid.Row="3" Click="Button_Click">
            <TextBlock Text="Create Second Grid in Code"></TextBlock>
        <GridSplitter Grid.Row="1" Height="10" Name="gridSplitter1" VerticalAlignment="Center" Width="Auto" ResizeDirection="Rows" HorizontalAlignment="Stretch" />
See Also