Answers

Apr 04, 2007 - 12:59 PM
Either select your DataGridView in thedesigner window and set the property "RowStyle|HorizontalAlign" to "Right" or change the HTML code and add "align=right" to the tags.
Cheers
Peter
Answer this question
Please wait...
Cheers
Peter

Apr 04, 2007 - 01:25 PM
thanks, Peter.
I forgot to say that it's windows forms, not asp.net, so the solution doesn't work unfortunately.
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
Oh sorry, I am deep in ASP.Net development at the moment so my brain was focussed on this! Sorry!
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.
Cheers
Peter
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.
Cheers
Peter

Apr 05, 2007 - 02:00 AM
thank you Peter, that worked.
I found that the equivalent by code is:
this.dataGridView1.Columns["CustomerName"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
and the points go to..... Peter!!! :)
I found that the equivalent by code is:
this.dataGridView1.Columns["CustomerName"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
and the points go to..... Peter!!! :)
Answer this question
Other Questions Needing Answers
About Quomon
Quomon is a network of IT professionals from around the world, collaborating by sharing knowledgeable answers in their specific field of expertise.

Please wait...
Add New Comment