Version

RowAlternateAppearance Property (UltraGridOverride)

Returns or sets the Appearance object for alternate rows.
Syntax
'Declaration
 
Public Property RowAlternateAppearance As Infragistics.Win.AppearanceBase
public Infragistics.Win.AppearanceBase RowAlternateAppearance {get; set;}
Remarks

The RowAlternateAppearance property is used in conjunction with the RowAppearance property to apply different formatting options to odd and even rows in the grid. Even-numbered rows will use the Appearance specified by the RowAlternateAppearance property. If you do not specify a value for RowAlternateAppearance, the Appearance specified by RowAlternateAppearance will apply to all the rows in the band or the grid.

When you assign an Appearance object to the RowAlternateAppearance property, the properties of that object will be applied to the even-numbered rows belonging to the object specified. You can use the RowAlternateAppearance property to examine or change any of the appearance-related properties that are currently assigned to the rows, for example:

UltraWinGrid1.Override.RowAppearance.ForeColor = vbRed

Because you may want the alternate rows to look different at different levels of a hierarchical record set, RowAlternateAppearance is a property of the UltraGridOverride object. This makes it easy to specify different alternate row appearances for each band by assigning each UltraGridBand object its own UltraGridOverride object. If a band does not have an override assigned to it, the control will use the override at the next higher level of the override hierarchy to determine the properties for that band. In other words, any band without an override will use its parent band's override, and the top-level band will use the grid's override. Therefore, if the top-level band does not have its override set, the alternate rows of that band will use the grid-level setting of RowAlternateAppearance.

You can override the RowAlternateAppearance setting for specific rows by setting the Appearance property of the UltraGridRow object directly. The row will always use the values of its own Appearance object before it will use the values inherited from the Appearance object specified by the RowAlternateAppearance property of the band it occupies.

Example
Following code sets the RowAlternateAppearance on the layout's override and a band's override.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

  Private Sub Button47_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button47.Click

      ' RowAlternateAppearance applies to alternate rows in the UltraGrid.

      ' Set the RowAlternateAppearance on the layout's override.
      Me.ultraGrid1.DisplayLayout.Override.RowAlternateAppearance.BackColor = Color.LightSkyBlue

      ' You can override that grid-wide setting for a particular band by setting it on the
      ' override of that band.
      Me.ultraGrid1.DisplayLayout.Bands(1).Override.RowAlternateAppearance.BackColor = Color.LightYellow

  End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void button47_Click(object sender, System.EventArgs e)
{

	// RowAlternateAppearance applies to alternate rows in the UltraGrid.

	// Set the RowAlternateAppearance on the layout's override.
	this.ultraGrid1.DisplayLayout.Override.RowAlternateAppearance.BackColor = Color.LightSkyBlue;

	// You can override that grid-wide setting for a particular band by setting it on the
	// override of that band.
	this.ultraGrid1.DisplayLayout.Bands[1].Override.RowAlternateAppearance.BackColor = Color.LightYellow;

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also