DataGrid Individual cell Alignment

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have to change the font and color of negative values in my data grid. I
have it all working except that I cannot get the value to right align in the
cell. I have derived a control from the DataGridTextBoxColumn and have
override the paint method. I am able to get the value to show with the
correct font and color but it is left aligned, I cannot get it right aligned.

FYI....this is the article I read to figure the rest of this out.
http://msdn.microsoft.com/library/d...ry/en-us/dnwinforms/html/wnf_CustDataGrid.asp
 
Hi Marc.

Where you did the

new DataGridTextBoxColumn()

you should be able to set the Alignment property to
HorizontalAlignment.Right (left is the default).


If you do not mind, I would be interested in how you conditionally changed
the font/color..presumable on a row specific basis. (?) I am currently stuck
on that matter.

In my case, for values in the data grid, if there are other data conditions
existing, I want to 'highlight' either the field or the whole row, so a scan
of the grid makes those rows stand out.

Can you help me out on that?

Thanks.

Tom Stratford
(e-mail address removed)
 
Back
Top