Editing Alternate Rows in the XamDataGrid

[Infragistics] Andrew Flick / Saturday, February 28, 2009

Turn on Alternate Row Highlighting:

 

<igDP:XamDataGrid x:Name="XamDataGrid1" BindToSampleData="True" >
    <igDP:XamDataGrid.FieldLayoutSettings>
        <igDP:FieldLayoutSettings HighlightAlternateRecords="True"/>
    </igDP:XamDataGrid.FieldLayoutSettings>
</igDP:XamDataGrid>

 

To set the colors of the Alternate Row, simply create a style for the BackgroundAlternate Property:

<Window.Resources>
    <Style TargetType="{x:Type igDP:DataRecordCellArea}">
        <Setter Property="BackgroundAlternate">
            <Setter.Value>
            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                <GradientStop Color="#FF8790AD" Offset="0"/>
                <GradientStop Color="#FF424759" Offset="0.5"/>
                <GradientStop Color="#FF505DA3" Offset="0.5"/>
                <GradientStop Color="#FF2D2DDE" Offset="1"/>
            </LinearGradientBrush>
            </Setter.Value>
        </Setter>
    </Style>
</Window.Resources>