DataGridColumnStyle.AlignmentChanged Event

Definition

Occurs when the Alignment property value changes.

C#
public event EventHandler AlignmentChanged;

Event Type

Examples

The following code example demonstrates the use of this member.

C#
private void AlignmentChanged_Click(object sender, EventArgs e)
{
     myMessage = "Alignment has been Changed"; 
}
private void AddCustomDataTableStyle()
{
   // Create a 'DataGridTableStyle'.
   DataGridTableStyle myDataTableStyle = new DataGridTableStyle();
   myDataTableStyle.MappingName = "Customers";
   // Create a 'DataGridColumnStyle'.
   myDataGridColumnStyle = new DataGridTextBoxColumn();
   myDataGridColumnStyle.MappingName = "CustName";
   myDataGridColumnStyle.HeaderText = "Customer Name";
   myDataGridColumnStyle.Width = 250;
   myDataGridColumnStyle.AlignmentChanged+=new EventHandler(AlignmentChanged_Click);
   // Add the 'DataGridColumnStyle' to 'DataGridTableStyle'.
   myDataTableStyle.GridColumnStyles.Add(myDataGridColumnStyle);
   // Add the 'DataGridTableStyle' to 'DataGrid'.
   myDataGrid.TableStyles.Add(myDataTableStyle);
}

Applies to

Produkt Versioner
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 10