Rank: Newbie Groups: Member
Joined: 2/9/2011 Posts: 2
|
Any way to have conditonal formatting for more than one condition? I want to have different colors for rows in a grid for multiple conditioins. For example, if a Status field has a value of "Hold" I want the rows to be yellow and if a Status field has a value of "Completed" I want the rows to be red and so on...
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You will have to have the "computed column" in you data source that reflects the final value of the style. The Grid only takes one value. So whatever computation has to be done before you pass it to the Grid.
Thanks!
|
Rank: Newbie Groups: Member
Joined: 2/9/2011 Posts: 2
|
So, I can't have multiple conditions reflected for grid rows?
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
You can. You just have to figure out a single final value based on your whatever conditions. For example, for your original sample, if you pass the value of you Status Field to the Grid directly, then the Grid row will have style "Hold" when the status is "Hold" and style "Completed" if status is "Completed". Whatever value the Grid got is directly mapped to your CSS rules. So for example, if you have a CSS rule "Hold" that is defined as "color: yellow", then the row with style value "Hold" will be yellow. If you do not have a CSS rule "Hold" but instead of "yellow_text", then you will have to pass "yellow_text" to the Grid, how to translate your database value "Hold" into CSS rule name "yellow_text" will be completely up to you.
The idea is the Grid doesn't care how many different status you have or where that status comes from. It interprets whatever you pass to it as a CSS style name and apply it directly. Just like regular CSS rule, there is no limit on how many different rules you can have.
Thanks
|