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

前端 未结 5 1960
有刺的猬
有刺的猬 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:22

    To set align text in dataGridCell you have two ways:

    Set the align for a specific cell or set for each cell of row.

    For one column go to Columns->DataGridViewCellStyle

    or

    For each column go to RowDefaultCellStyle

    The control panel is the same as the follow:

提交回复
热议问题