views:

137

answers:

1

Hi there,

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

+1  A: 

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.

Ragepotato
Hi Ragepotato, the first link doesn't show how to apply the validation rule to a column in a DataGrid. It just shows how to define a validation rule and i can't find how to apply it? And the second link uses the DataGrid from the Silverlight toolkit which i am not using and i can't get the code to work with a regular dataGrid
Billy
Sorry, I thought the lessons/patterns would be clear and allow you to apply them in other places.
Ragepotato
perhaps you should expand on your answer..... +1
almog.ori