TreeListView.FormatConditionGeneratorTemplate Property

Gets or sets a template that describes conditional formats. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v21.1.dll


public DataTemplate FormatConditionGeneratorTemplate { get; set; }

Property Value

Type Description

A conditional format template.


You can define conditional formatting rules in a ViewModel and apply them to the GridControl. To do this, follow the steps below:

  1. Create a collection of conditional formatting rules in a ViewModel and specify a data template that generates format conditions.

  2. Assign the conditional formatting rule collection to the FormatConditionsSource property and the format condition template to the FormatConditionGeneratorTemplate property:

    <dxg:GridControl ItemsSource="{Binding Orders}">
        <!-- ... -->
            <dxg:TreeListView FormatConditionsSource="{Binding Rules}"
                              FormatConditionGeneratorTemplate="{StaticResource BackgroundFormat}"/>

If you have multiple format condition templates, use the TreeListView.FormatConditionGeneratorTemplateSelector property to specify a template selector that chooses a template based on the format condition type.

Refer to the following help topic for more information: How to: Bind the Grid to a Collection of Conditional Formatting Rules.

See Also