Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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