I would like to set the background color of individual rows in my Silverlight GridControl based on the value of a property in bound data.
i.e. If the bound data items contain a boolean property called "Available" then I would like the entire grid row for an item where the "Available" property is false to have a grey backround and where the "Available" property is true to have a green background.
I have reviewed the documentation at http://documentation.devexpress.com/#Silverlight/CustomDocument5242 and am able to set the cell template as per the example given however I cannot figure how to achieve the required effect on rows.
Your help would be appreciated.
Thanks for your sample project. This solution worked perfectly.
However, there is a little problem.
The solution is fine provided the flag I use to set the color does not change.
If I change the value of the flag used to select the row color the INotifyChanged interface signals the changed state to the flag editor in the row but the row color does not change to reflect the new value.
Is there a solution to this problem?
I have attached a project that demonstrates the issue.
Please modify your binding to fix this issue to "Row.Marked"
For example :
Please try this solution, and let us know the results.[XAML]
<Binding Path="Row.Marked"> <Binding.Converter> <dx:BoolToObjectConverter TrueValue="Green" FalseValue="Gray"/> </Binding.Converter> </Binding>
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.