DataGridTableStyle.ResetBackColor Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Resets the BackColor property to its default value.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public void ResetBackColor()

You typically use this method if you are either creating a designer for the DataGridTableStyle or creating your own control incorporating the DataGridTableStyle.

The following code example demonstrates the use of this member.

private void AddCustomColumnStyle()
{
   // Set the TableStyle Mapping name.
   myTableStyle.MappingName = "customerTable";
   myTableStyle.BackColor = Color.Pink;

   // Set the ColumnStyle properties and add to TableStyle.
   myColumnStyle.MappingName = "Customers";
   myColumnStyle.HeaderText = "Customer Name";
   myColumnStyle.Width = 250;
   myTableStyle.GridColumnStyles.Add(myColumnStyle);
   myDataGrid.TableStyles.Add(myTableStyle);
}

private void myButton1_Click(object sender, EventArgs e)
{
   // Reset the background color.
   myTableStyle.ResetBackColor();
}

.NET Framework
Available since 1.1
Return to top
Show: