DetailDescriptorSelector Class
Enables you to select which detail descriptor to use in data dependent details.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v24.2.Core.dll
NuGet Package: DevExpress.Wpf.Grid.Core
Declaration
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.
<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>
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DetailDescriptorSelector 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.