how to switch datagrid font based on each recordset value

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

Guest

I have a datagrid that has a column called "Match". The only two values
available for this recordset column is a string value of "YES" or "NO". If
the value is "NO" then I need the font color to be red, else I need the font
color to be blue.
Thanks in advance for any help.
 
dsv1991,

I don't think that you can change the cell rendering on a cell-by-cell
basis. If anything, you would have to create a column style on your own
that would render the text for you (by deriving from the DataGridColumnStyle
class, I believe).

In .NET 2.0, the DataView class allows for rendering on a cell-by-cell
basis, and you could do this easily.

Hope this helps.
 
dsv1991 said:
I have a datagrid that has a column called "Match". The only two values
available for this recordset column is a string value of "YES" or "NO". If
the value is "NO" then I need the font color to be red, else I need the font
color to be blue.
Thanks in advance for any help.

If the datagrid is a windows forms type, there is an article on MSDN (plus a
link to VB and C# code) called 'Customizing the Windows Forms DataGrid' that
may show what you need.

HTH
Ron.
 
Back
Top