Skip to main content

GridControl.DetailDescriptor Property

Enables master-detail representation within this GridControl.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v23.2.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public DetailDescriptorBase DetailDescriptor { get; set; }

Property Value

Type Description
DetailDescriptorBase

A DetailDescriptorBase descendant specifying which details to display for this GridControl.

Remarks

This property is crucial to setting up the master-detail hierarchy within the GridControl. You need to initialize it with a proper DetailDescriptorBase descendant as outlined in the following table.

Detail Descriptor Purpose
DataControlDetailDescriptor Use this object to display another GridControl or any DataControlBase descendant within the Detail View. When using a GridControl, Detail View synchronization and Master View integration become avialable.
ContentDetailDescriptor Use this object to display any set of controls within the Detail View. You can also use it to display a GridControl if you don’t want Detail View synchronization or Master View Integration features that become enabled when using the DataControlDetailDescriptor.
TabViewDetailDescriptor Use this object to display multiple details within a tabbed container.

Refer to the following help topic for more information: Master-Detail Data Representation.

Example

This example creates tabbed details (TabViewDetailDescriptor) in the GridControl. The Orders tab displays the GridControl (DataControlDetailDescriptor), and the Notes tab displays a memo field (ContentDetailDescriptor).

WPF Grid - Create Tabbed Details

View Example: Display Detail Content in Tabs

<Window.Resources>
    <DataTemplate x:Key="EmployeeNotes">
        <TextBlock Text="{Binding Path=Notes}" TextWrapping="Wrap" Padding="4"/>
    </DataTemplate>
</Window.Resources>
<Grid>
    <dxg:GridControl x:Name="grid" AutoGenerateColumns="AddNew">
        <dxg:GridControl.View>
            <dxg:TableView DetailHeaderContent="Employees" AutoWidth="True" ShowGroupPanel="False"/>
        </dxg:GridControl.View>
        <dxg:GridControl.DetailDescriptor>
            <dxg:TabViewDetailDescriptor>
                <dxg:DataControlDetailDescriptor ItemsSourcePath="Orders">
                    <dxg:DataControlDetailDescriptor.DataControl>
                        <dxg:GridControl AutoGenerateColumns="AddNew">
                            <dxg:GridControl.View>
                                <dxg:TableView DetailHeaderContent="Orders" AutoWidth="True" ShowGroupPanel="False"/>
                            </dxg:GridControl.View>
                        </dxg:GridControl>
                    </dxg:DataControlDetailDescriptor.DataControl>
                </dxg:DataControlDetailDescriptor>
                <dxg:ContentDetailDescriptor ContentTemplate="{StaticResource EmployeeNotes}" HeaderContent="Notes"/>
            </dxg:TabViewDetailDescriptor>
        </dxg:GridControl.DetailDescriptor>
    </dxg:GridControl>
</Grid>

The following code snippets (auto-collected from DevExpress Examples) contain references to the DetailDescriptor property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also