change fore color of single cell in a datagrid

  • Thread starter Thread starter Erald Kulk
  • Start date Start date
E

Erald Kulk

L.S.

in a datagrid I would like the forecolor of a single cell. Because it
is a negative number. This cannot be done by changing the NumberFormat
property.
So how can I do this??

Erald
 
Erald,

This is difficult with the current DataGrid. The reason is that
determining how to render contents on the grid is done on a per-column
basis. Because of this, you would have to create a class that derives from
DataGridColumnStyle and then handle the rendering of the background color
based on the value.

Hope this helps.
 
Erald,

Honestly, I do think that it is the wrong way (the way they implemented
it). I think that there are third party controls out there which do a much
better job. One of the ones I like is the grid from Xceed software. You
can find more information about it at:

http://www.xceedsoft.com/products/GridNet/
 
thank you for the advise. By extending the DataGridColumnStyle and
changing the overridden pain method I created the datagrid I intended
to have. New problem. This column has an expression to calculate its
values. But this generates an error when saving. cannot change the
readonly property of the expressioncolumn. or something like that. I
got the error in dutch.

anybody any idea?

Erald Kulk
 
Back
Top