DataGridColumnStyle::MappingNameChanged Event

 

Occurs when the MappingName value changes.

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

public:
event EventHandler^ MappingNameChanged {
	void add(EventHandler^ value);
	void remove(EventHandler^ value);
}

The following code example demonstrates the use of this member.

private:
   void AddCustomColumnStyle()
   {
      DataGridTableStyle^ myTableStyle = gcnew DataGridTableStyle;
      myTableStyle->MappingName = "Orders";
      myColumnStyle = gcnew DataGridTextBoxColumn;
      myColumnStyle->MappingName = "Orders";
      myColumnStyle->HeaderText = "Orders";
      myTableStyle->GridColumnStyles->Add( myColumnStyle );
      myDataGrid->TableStyles->Add( myTableStyle );
      myColumnStyle->MappingNameChanged += gcnew EventHandler( this, &MyForm::columnStyle_MappingNameChanged );
      flag = (bool *)true;
   }

   // MappingNameChanged event handler of DataGridColumnStyle.
   void columnStyle_MappingNameChanged( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      MessageBox::Show( "Mapping Name changed" );
   }

.NET Framework
Available since 1.1
Return to top
Show: