How can I apply a formula to color a certain cell in XamDataGrid? In the included example, I want to color the cell under Column "Count" ONLY if that row's Count / Last Count < 0.90. Example solution provided, and here's a picture showing what i need outcome to do. Basically highlight the cell for each row where count is more than 90% of lastcount.
oops i meant less than 90%. And here's the pic... Doesn't have to be outlined in red, i would actually prefer changing the cell's background to a slightly transparent red or something, but i just can't figure out how to act on the cell anyway...
Hello Travis,
Thank you for your post!
I have been looking into it and have created a small sample application for you.
In the sample application I have a simple XamDataGrid bind to a collection. In order to achieve the functionality you want I have created a style for the CellValuePresenter. In this style I create a MultiBinding, in order to bind to the two columns, based on which the color of the cell should change.
I also created a MultiValueConverter, where I calculate the value the percentages and return the desired color for the cells.
Please find the attached sample application and feel free to let me know if you have any further questions on this matter.