Help please! How can I dynamically change for.ex. a grid cell fore color value w.r.t a condition?

I have a column in a DataGridView which I want to show it with a different fore color-dynamically-according to a field value.
I tried to find an Inline if operator (like iif(bool, value1, value2) in other languages) but I can't in C#. Is there any operator for this goal in C# .Net 2005
Thank in advance.



Answer this question

Help please! How can I dynamically change for.ex. a grid cell fore color value w.r.t a condition?

  • Silvia CR

    The following expression is equivalent to the VB expression
    (iif(bool, value1, value2))

    val =  bool value1:value1;



  • Maheswari

    Thanks a lot Eisa Smile, It's  just I was looking.
  • Help please! How can I dynamically change for.ex. a grid cell fore color value w.r.t a condition?