DataViewBase.DetailHeaderContent Property

Gets or sets the detail section's header content.

Namespace: DevExpress.Xpf.Grid

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

Declaration

public object DetailHeaderContent { get; set; }
Public Property DetailHeaderContent As Object

Property Value

Type Description
Object

An object representing the detail section's header content.

Remarks

Details display header sections when the DetailDescriptorBase.ShowHeader option is enabled. When using a DataControlDetailDescriptor, you can specify the header section content via the detail Grid View's DataViewBase.DetailHeaderContent. If no template has been assigned to the DetailDescriptorBase.HeaderContentTemplate, then the header will display the textual representation of the assigned content object. If you specify a template, then the DataViewBase.DetailHeaderContent will define the DataContext for the template.

The following image shows a detail header section's default representation (when no template has been assigned).

Grid-Master-Detail-Header-Content

The DetailHeaderContent property also specifies the string representation of the Detail section within the Group Panel, Filter Panel and detail tab headers. For ContentDetailDescriptor objects, use the ContentDetailDescriptor.HeaderContent property. The following image shows these two properties in action.

Master-Detail-Header-Content

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