I want to create a style. When cell value is updated from user interface, the foreground color in that cell would change. How can I do it?
Hello,
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
I have reproduced the steps you have described, but it seems like that on my side everything works ok, so could you please send me an isolated sample project, where the issues you described are reproducible. Also could you tell me the steps, I need to follow, so the issues are reproduced, so I can investigate them further for you.
Looking forward for your reply.
I tried it. But there are two issues. One is that after I change the editor foreground, the cell enters edit mode again and call the cell changed event again. The other issue is that when I change the data source of the grid after some cell changes, some random cell in the same field gets the highlighted foreground color. Can you please help again?
Hello Zheng,
Thank you for your post. I have been looking into it and I suggest you use the following code in your XamDataGrid’s CellChanged event:
e.Editor.Foreground = Brushes.YellowGreen;
Please let me know if this is what you want to achieve or I have misunderstood you in some way.