DataGridColumnStyle::AlignmentChanged Event

 

Occurs when the Alignment property value changes.

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

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

The following code example demonstrates the use of this member.

private:
   void AlignmentChanged_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      myMessage = "Alignment has been Changed";
   }

   void AddCustomDataTableStyle()
   {
      // Create a 'DataGridTableStyle'.
      DataGridTableStyle^ myDataTableStyle = gcnew DataGridTableStyle;
      myDataTableStyle->MappingName = "Customers";

      // Create a 'DataGridColumnStyle'.
      myDataGridColumnStyle = gcnew DataGridTextBoxColumn;
      myDataGridColumnStyle->MappingName = "CustName";
      myDataGridColumnStyle->HeaderText = "Customer Name";
      myDataGridColumnStyle->Width = 250;
      myDataGridColumnStyle->AlignmentChanged += gcnew EventHandler( this, &Form1::AlignmentChanged_Click );

      // Add the 'DataGridColumnStyle' to 'DataGridTableStyle'.
      myDataTableStyle->GridColumnStyles->Add( myDataGridColumnStyle );

      // Add the 'DataGridTableStyle' to 'DataGrid'.
      myDataGrid->TableStyles->Add( myDataTableStyle );
   }

.NET Framework
Available since 1.1
Return to top
Show: