Tutorial :Silverlight DataGrid: changing the color of certain cells



Question:

When I bind my datasource to my grid

 dataGrid.DataContext = myObservableCollection;  

.. and when a value of a cell is for example >100 how can I have the cell pulsate on and off in a different color?

Thanks for the help


Solution:1

To check if the value of the cell is over 100 you can use a ValidationRule.

Here is an example of using a custom rule and adding a red border around the cell in error. From there you should be able to extend the example from a red border to an animation (achieving the color pulsating).

I've omitted a code sample as the mini tutorial has a well illustrated solution to your problem.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »