DataGridTableStyle.ResetAlternatingBackColor Method
Resets the AlternatingBackColor property to its default value.
[Visual Basic] Public Sub ResetAlternatingBackColor() [C#] public void ResetAlternatingBackColor(); [C++] public: void ResetAlternatingBackColor(); [JScript] public function ResetAlternatingBackColor();
Remarks
You typically use this method if you are either creating a designer for the DataGridTableStyle or creating your own control incorporating the DataGridTableStyle. You can use the ShouldSerializeAlternatingBackColor method to determine whether the property value has changed from its default.
Example
[Visual Basic] Private Sub myButton1_Click(sender As Object, e As EventArgs) 'Set the 'AlternatingBackColor'. myDataGridTableStyle.AlternatingBackColor = Color.Blue End Sub 'myButton1_Click Private Sub myButton2_Click(sender As Object, e As EventArgs) ' Reset the 'AlternatingBackColor'. myDataGridTableStyle.ResetAlternatingBackColor() End Sub 'myButton2_Click [C#] private void myButton1_Click(object sender,EventArgs e) { //Set the 'AlternatingBackColor'. myDataGridTableStyle.AlternatingBackColor=Color.Blue; } private void myButton2_Click(object sender,EventArgs e) { // Reset the 'AlternatingBackColor'. myDataGridTableStyle.ResetAlternatingBackColor(); } [C++] private: void myButton1_Click(Object* /*sender*/, EventArgs* /*e*/) { //Set the 'AlternatingBackColor'. myDataGridTableStyle->AlternatingBackColor=Color::Blue; } void myButton2_Click(Object* /*sender*/, EventArgs* /*e*/) { // Reset the 'AlternatingBackColor'. myDataGridTableStyle->ResetAlternatingBackColor(); }
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also
DataGridTableStyle Class | DataGridTableStyle Members | System.Windows.Forms Namespace