Back to Devexpress

PropertyGridControl.AlternationCount Property

wpf-devexpress-dot-xpf-dot-propertygrid-dot-propertygridcontrol-25946d19.md

latest2.7 KB
Original Source

PropertyGridControl.AlternationCount Property

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

Namespace : DevExpress.Xpf.PropertyGrid

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

NuGet Package : DevExpress.Wpf.PropertyGrid

Declaration

csharp
public int AlternationCount { get; set; }
vb
Public Property AlternationCount As Integer

Property Value

TypeDefaultDescription
Int320

The alternate row frequency.

|

Remarks

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

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:

xaml
<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

RowStyle

PropertyGridControl Class

PropertyGridControl Members

DevExpress.Xpf.PropertyGrid Namespace