You are viewing help content for pre-release software. This document and the features it describes are subject to change. Switch to the current version.

DataControlDetailDescriptor Class

Represents a detail that displays a grid control and natively integrates with the master grid.

Namespace: DevExpress.Xpf.Grid

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

Declaration

public class DataControlDetailDescriptor :
    DetailDescriptorBase,
    IDataControlOwner
Public Class DataControlDetailDescriptor
    Inherits DetailDescriptorBase
    Implements IDataControlOwner

Remarks

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

The following are the main members that you will need to work with when using a DataControlDetailDescriptor:

Member Description
DataControlDetailDescriptor.ItemsSourcePath Gets or sets the detail grid's data binding by specifying the path relative to the master grid's records.
DataControlDetailDescriptor.DataControl Gets or sets the GridControl that displays detail data.
DataViewBase.DetailHeaderContent Gets or sets the detail section's header content.

If you are using the DataControlDetailDescriptor to display a Detail, the following integration features become available:

  • Detail synchronization
  • Single scrollbar for both master and detail views
  • Common group panel displayed at the top of the master view
  • Common filter panel displayed at the bottom of the master view
NOTE

The DataControlDetailDescriptor does not support UI Automation.

Examples

The following example shows how to create a new grid and set up Master-Detail data representation in code. When setting up a Master-Detail hierarchy, a detail grid and a custom detail section are placed within a tabbed container. So, the following Detail Descriptor types are used: DataControlDetailDescriptor, ContentDetailDescriptor, and TabViewDetailDescriptor.

View Example

<dxg:GridControl Grid.Row="0" Name="gridControl1" AutoGenerateColumns="AddNew" >
    <dxg:GridControl.View>
        <dxg:TableView DetailHeaderContent="Employees" AutoWidth="True" ShowGroupPanel="False"  />
    </dxg:GridControl.View>
    <dxg:GridControl.DetailDescriptor>
        <dxg:TabViewDetailDescriptor>
            <dxg:TabViewDetailDescriptor.DetailDescriptors>
                <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:ContentDetailDescriptor>
            </dxg:TabViewDetailDescriptor.DetailDescriptors>
        </dxg:TabViewDetailDescriptor>
    </dxg:GridControl.DetailDescriptor>
</dxg:GridControl>
See Also