wpf-devexpress-dot-xpf-dot-propertygrid-dot-propertygridcontrol-25946d19.md
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
public int AlternationCount { get; set; }
Public Property AlternationCount As Integer
| Type | Default | Description |
|---|---|---|
| Int32 | 0 |
The alternate row frequency.
|
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:
<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