Skip to main content
All docs
V24.2

PropertyGridControl.AlternationCount Property

Gets or sets the alternate row frequency. This is a dependency property.

Namespace: DevExpress.Xpf.PropertyGrid

Assembly: DevExpress.Xpf.PropertyGrid.v24.2.dll

NuGet Package: DevExpress.Wpf.PropertyGrid

Declaration

public int AlternationCount { get; set; }

Property Value

Type Default Description
Int32 0

The alternate row frequency.

Remarks

Use the AlternationCount property to alternate row colors. The following image illustrates AlternationCount set to 2:

WPF Property Grid - Alternate Rows

The PropertyGridControl populates ItemsControl.AlternationIndex properties for each row based on the AlternationCount property value. As a result, you can use the PropertyGridControl.RowStyle property to specify a custom alternation appearance:

WPF Property Grid - Custom Row Alternation

<dxprg:PropertyGridControl ...
                           AlternationCount="3">
    <dxprg:PropertyGridControl.RowStyle>
        <Style TargetType="dxprg:RowControl">
            <Style.Triggers>
                <Trigger Property="ItemsControl.AlternationIndex" Value="1">
                    <Setter Property="Background" Value="#122C2C2C"/>
                </Trigger>
                <Trigger Property="ItemsControl.AlternationIndex" Value="2">
                    <Setter Property="Background" Value="LightGray"/>
                </Trigger>
            </Style.Triggers>
        </Style>
    </dxprg:PropertyGridControl.RowStyle>
</dxprg:PropertyGridControl>
See Also