Skip to main content

DetailDescriptorTrigger Class

Represents a trigger that selects a proper detail for each master row conditionally.

Namespace: DevExpress.Xpf.Grid

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

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public class DetailDescriptorTrigger :
    DXTriggerBase

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 DetailDescriptorTrigger class.

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