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

前端 未结 5 1971
有刺的猬
有刺的猬 2021-02-01 12:06

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

5条回答
  •  花落未央
    2021-02-01 12:30

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

提交回复
热议问题