Back to Devexpress

DataControlDetailDescriptor.DataControl Property

wpf-devexpress-dot-xpf-dot-grid-dot-datacontroldetaildescriptor.md

latest6.0 KB
Original Source

DataControlDetailDescriptor.DataControl Property

Gets or sets the GridControl that displays detail data.

Namespace : DevExpress.Xpf.Grid

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public DataControlBase DataControl { get; set; }
vb
Public Property DataControl As DataControlBase

Property Value

TypeDescription
DataControlBase

A GridControl that displays detail data. Although the property type is DataControlBase, it currently only accepts GridControl objects and otherwise, throws exceptions.

|

Remarks

DataControlDetailDescriptor was specifically designed for tight master and detail view integration. In the current version, this kind of integration has been implemented only between two TableView objects. This means that you can only assign a GridControl to the DataControl property and that a detail grid control can only use a TableView to present data. In other cases, exceptions will be thrown.

The data binding for the detail grid is specified by the DataControlDetailDescriptor.ItemsSourcePath property.

Once you’ve assigned a GridControl to this property and specified the data binding, customize it’s setting to change the detail grid’s appearance and behavior. Note also that detail grids are integrated into the master grid’s Group Panel, Filter Panel and other UI Elements. The detail is identified in those elements by the string representation of the DataViewBase.DetailHeaderContent property value.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DataControl 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.

wpf-data-grid-display-detail-content-in-tabs/CS/WpfApplication18/MainWindow.xaml#L19

xml
<dxg:DataControlDetailDescriptor ItemsSourcePath="Orders">
    <dxg:DataControlDetailDescriptor.DataControl>
        <dxg:GridControl AutoGenerateColumns="AddNew">

wpf-data-grid-expand-and-collapse-master-rows/CS/WpfApplication21/MainWindow.xaml#L18

xml
<dxg:DataControlDetailDescriptor ItemsSourcePath="Orders">
    <dxg:DataControlDetailDescriptor.DataControl>
        <dxg:GridControl AutoGenerateColumns="AddNew">

wpf-data-grid-display-custom-content-in-grid-details/CS/WpfApplication18/MainWindow.xaml.cs#L59

csharp
GridControl detailGrid = new GridControl();
dataControlDetail.DataControl = detailGrid;
detailGrid.AutoGenerateColumns = AutoGenerateColumnsMode.AddNew;

wpf-data-grid-create-master-detail-grid-in-code/CS/MasterDetailInCode/MainWindow.xaml.cs#L35

csharp
gridDetail.ItemsSourcePath = nameof(Employee.Orders);
gridDetail.DataControl = detailGridControl;

wpf-data-grid-display-custom-content-in-grid-details/VB/WpfApplication18/MainWindow.xaml.vb#L54

vb
Dim detailGrid As New GridControl()
dataControlDetail.DataControl = detailGrid
detailGrid.AutoGenerateColumns = AutoGenerateColumnsMode.AddNew

wpf-data-grid-create-master-detail-grid-in-code/VB/MasterDetailInCode/MainWindow.xaml.vb#L37

vb
gridDetail.ItemsSourcePath = NameOf(Employee.Orders)
gridDetail.DataControl = detailGridControl
Dim customDetail As ContentDetailDescriptor = New ContentDetailDescriptor()

See Also

DetailDescriptor

ItemsSourcePath

DetailHeaderContent

DataControlDetailDescriptor Class

DataControlDetailDescriptor Members

DevExpress.Xpf.Grid Namespace