Skip to main content

DetailDescriptorSelector.DefaultValue Property

Gets or sets the default detail descriptor for the DetailDescriptorSelector selector.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v24.1.Core.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public DetailDescriptorBase DefaultValue { get; set; }

Property Value

Type Description
DetailDescriptorBase

A DetailDescriptorBase object that is a default detail descriptor.

Remarks

Use the DefaultValue property to define a default detail descriptor when data dependent details are used. To enable selecting alternative detail descriptors, populate the DetailDescriptorSelector.Items collection with triggers that enable a required detail descriptor when a custom condition is satisfied.

Example

In this example, the DetailDescriptorSelector displays different details based on the master row’s content. Assign the default detail descriptor to the DetailDescriptorSelector.DefaultValue property and use DetailDescriptorTriggers to conditionally switch it to an another detail. This trigger has the Binding and Value properties which work similarly to corresponding properties in a standard WPF DataTrigger.

WPF Data Grid - Display Different Details Based on Master Row Data

View Example: Display Different Details Based on Data in the Master Row

<dxg:GridControl AutoGenerateColumns="AddNew" ItemsSource="{Binding Tasks}">
    <dxg:GridControl.DetailDescriptor>
        <dxg:DetailDescriptorSelector>
            <dxg:DetailDescriptorSelector.DefaultValue>
                <dxg:DataControlDetailDescriptor ItemsSourcePath="CompletedActions">
                    <dxg:GridControl AutoGenerateColumns="AddNew">
                        <dxg:GridControl.View>
                            <dxg:TableView ShowGroupPanel="False"/>
                        </dxg:GridControl.View>
                    </dxg:GridControl>
                </dxg:DataControlDetailDescriptor>
            </dxg:DetailDescriptorSelector.DefaultValue>
            <dxg:DetailDescriptorTrigger Binding="{Binding Succeed}" Value="False">
                <dxg:DataControlDetailDescriptor ItemsSourcePath="Errors">
                    <dxg:GridControl AutoGenerateColumns="AddNew">
                        <dxg:GridControl.View>
                            <dxg:TableView ShowGroupPanel="False"/>
                        </dxg:GridControl.View>
                    </dxg:GridControl>
                </dxg:DataControlDetailDescriptor>
            </dxg:DetailDescriptorTrigger>
        </dxg:DetailDescriptorSelector>
    </dxg:GridControl.DetailDescriptor>
    <dxg:GridControl.View>
        <dxg:TableView AutoWidth="True" ShowGroupPanel="False"/>
    </dxg:GridControl.View>
</dxg:GridControl>

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DefaultValue 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