DataGridTableStyle::ResetBackColor Method ()

 

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 );
   }

   void myButton1_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      // Reset the background color.
      myTableStyle->ResetBackColor();
   }

.NET Framework
Available since 1.1
Return to top
Show: