.netwinformsdatagridviewdatagridviewcolumn

How can I right-align text in a DataGridView column?


How can I right-align text in a DataGridView column? I am writing a .NET WinForms application.


Solution

  • this.dataGridView1.Columns["CustomerName"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;