ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

C1TrueDBGrid.AlternatingRows Property

Gets or sets a value indicating whether the grid or split uses the OddRowStyle for odd-numbered rows and EvenRowStyle for even-numbered rows.

[Visual Basic]

Public Property AlternatingRows As Boolean

[C#]

public bool AlternatingRows {get;set;}

[Delphi]

public property AlternatingRows: Boolean read get_AlternatingRows write set_AlternatingRows;

Remarks

If True, the OddRowStyle and EvenRowStyle properties control the appearance of rows within the specified object.

If False (the default), the Style property controls the display of rows within the specified object.

Example

The following code uses the AlternatingRows property to show alternating row style in the C1TrueDBGrid:

·      Visual Basic

       Me.C1TrueDBGrid1.AlternatingRows = True

·      C#

       this.c1TrueDBGrid1.AlternatingRows = true;

·      Delphi

       Self.C1TrueDBGrid1.AlternatingRows := True;

Note: By default, the BackColor property of the EvenRowStyle style is set to Aqua. Therefore, the first row's back color appears aqua and every other row thereafter.

For an example demonstrating the AlternatingRows property, see Tutorial 12 - Displaying Rows in Alternating Colors.

See Also

C1TrueDBGrid Class | C1TrueDBGrid Members | C1.Win.C1TrueDBGrid Namespace


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.