TeflonJon
asked on
DataGridView Column Header Alignment
I've found a lot of answers on how to align the Header Text for a column but when I set the HeaderText to MiddleRight alignment, there is some sort of padding after the Header text that I can't figure out how to get rid of. Since this is hard to describe, I've posted a sample picture with the problem circled in red at: http://i7.photobucket.com/albums/y279/abso_lushen/EESample.jpg
The code I use to Right Align the column is below:
DataGridView1.Columns(1).H eaderCell. Style.Alig nment = DataGridViewContentAlignme nt.MiddleR ight 'Aligns the Header Text
DataGridView1.Columns(1).D efaultCell Style.Alig nment = DataGridViewContentAlignme nt.MiddleR ight 'Just aligns the cell contents
I should also mention that I've tried turning EnableHeadersVisualStyles off and that did not solve the problem. I've also tried TopRight and BottomRight with no change.
Thanks in Advance,
Jon Beck
The code I use to Right Align the column is below:
DataGridView1.Columns(1).H
DataGridView1.Columns(1).D
I should also mention that I've tried turning EnableHeadersVisualStyles off and that did not solve the problem. I've also tried TopRight and BottomRight with no change.
Thanks in Advance,
Jon Beck
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Jon