Apr 04, 2007 - 12:59 PM
Apr 04, 2007 - 01:25 PM
I forgot to say that it's windows forms, not asp.net, so the solution doesn't work unfortunately.
Apr 04, 2007 - 01:36 PM
For a windows app, look at RowTemplate property of the GridView component, expand the sub nodes and click on the [...] for DefaultCellStyle. This will open the CellStyle Builder. Set the Alignment property in the Layout section.
Apr 05, 2007 - 02:00 AM
I found that the equivalent by code is:
this.dataGridView1.Columns["CustomerName"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
and the points go to..... Peter!!! :)