IsAlternatingRowStyleEnabled Property
See Also  Example
Xceed.Wpf.DataGrid Assembly > Xceed.Wpf.DataGrid.Views Namespace > TableView Class : IsAlternatingRowStyleEnabled Property

Gets or sets a value indicating whether an alternate style is applied to every other row.

Syntax

Visual Basic (Declaration) 
Public Property IsAlternatingRowStyleEnabled As Boolean
C# 
public bool IsAlternatingRowStyleEnabled {get; set;}

Return Value

true if an alternate style is applied to every other row; false otherwise. The default value of this property is usually false; however, for some themes, alternate row styles may be enabled by default.

Example

All examples in this topic assume that the grid is bound to the Orders table of the Northwind database, unless stated otherwise.
The following example demonstrates how to enable alternating row styles.
XAMLCopy Code
<Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"> 
  <Grid.Resources> 
     <xcdg:DataGridCollectionViewSource x:Key="cvs_orders" 
                                        Source="{Binding Source={x:Static Application.Current}, Path=Orders}" /> 
    <Style TargetType="{x:Type xcdg:TableView}"> 
       <Setter Property="IsAlternatingRowStyleEnabled" 
               Value="True" /> 
    </Style> 
  </Grid.Resources> 
 
  <xcdg:DataGridControl ItemsSource="{Binding Source={StaticResource cvs_orders}}" 
                        AutoCreateDetailConfigurations="True"> 
     <xcdg:DataGridControl.DefaultDetailConfiguration> 
       <xcdg:DefaultDetailConfiguration xcdg:TableView.IsAlternatingRowStyleEnabled="False"/> 
     </xcdg:DataGridControl.DefaultDetailConfiguration> 
  </xcdg:DataGridControl> 
</Grid>

Remarks

This property represents the local CLR property of the IsAlternatingRowStyleEnabled attached property.

Requirements

Supported Frameworks: Microsoft .NET Framework version 3.5

See Also