DataGrid.AlternatingBackColor Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the background color of odd-numbered rows of the grid.
public:
property System::Drawing::Color AlternatingBackColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };
public System.Drawing.Color AlternatingBackColor { get; set; }
member this.AlternatingBackColor : System.Drawing.Color with get, set
Public Property AlternatingBackColor As Color
Property Value
A Color that represents the alternating background color. The default is the system color for windows (Window).
Examples
The following code example sets the AlternatingBackColor to a Color value.
Private Sub ChangeAltBackClr(ByVal myGrid As DataGrid, _
ByVal myColor As Color)
myGrid.AlternatingBackColor = myColor
End Sub
Remarks
By default, both the BackColor and the AlternatingBackColor properties are set to the same color. Setting the BackColor property affects only even-numbered rows, while setting the AlternatingBackColor affects only odd-numbered rows.