<igDP:XamDataPresenter x:Name="XamDataPresenter1" ... > <igDP:XamDataPresenter.FieldLayoutSettings> <igDP:FieldLayoutSettings HighlightAlternateRecords="True" /> </igDP:XamDataPresenter.FieldLayoutSettings> </igDP:XamDataPresenter>
The xamDataPresenter’s™ Grid View can style alternating rows (records) to give end users an easier time differentiating between rows. This feature is easily enabled off the FieldLayoutSettings object by setting the HighlightAlternateRecords property to True.
The following procedure assumes you have a data bound xamDataPresenter, and you want to enable alternating row colors. For more information, see Adding xamDataPresenter to Your Application.
The following XAML creates an instance of XamDataPresenter and names it. The XAML then specifies a xamDataPresenter FieldLayoutSettings object and sets the HighlightAlternateRecords property to True.
In XAML:
<igDP:XamDataPresenter x:Name="XamDataPresenter1" ... > <igDP:XamDataPresenter.FieldLayoutSettings> <igDP:FieldLayoutSettings HighlightAlternateRecords="True" /> </igDP:XamDataPresenter.FieldLayoutSettings> </igDP:XamDataPresenter>
Build and run the project. You should see xamDataPresenter’s Grid View with alternating rows similar to the image below.