How can I right-align text in a DataGridView column? I am writing a .NET WinForms application.
相关问题
- Generic Generics in Managed C++
- How to Debug/Register a Permanent WMI Event Which
- 'System.Threading.ThreadAbortException' in
- Bulk update SQL Server C#
- Should I use static function in c# where many call
I know this is old, but for those surfing this question ... the answer by MUG4N will align all columns that use the same defaultcellstyle. I'm not using autogeneratecolumns so that is not acceptible. Instead I used:
e in this case is from:
i have same problem and i finally found the answer there is an option in properties in datagridview , it name is "Right to left" just change to "yes"
it works!
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: