Hi,
I have a requirement where I need to change the foreground color of the cell (or any visual indicator) in a xamdatagrid cell that would mark that the cell has been edited by the user.Also note, the cell should get restored to normal style if the user enters back the ld value.
My view model supports momento and I have a boolean property for every property that is shown in the grid.I am able to achieve what I want by overriding the cell value presenter style but seems thee are some glitch.In the attached example click the set right button in the bottom to see that the changes black foreground is not restored (it gets restored if you click the cells, why?!).Also the red foreground is changed to black if you hover your mouse on any other cell of the same row that has the changed cell.Can you please have a look. If you think there is a better way of doing this, please let me know.
Hello Sid,
Thank you for your post!
I have been looking into it and it seems that I am missing something from your scenario. If you would like to change the foreground color of the cell, when the data in it is not valid, I can suggest using the IDataErrorInfo interface. More about that you ca find on the following link from our documentation: http://help.infragistics.com/Help/Doc/WPF/2015.1/CLR4.0/html/xamDataPresenter_Enable_IDataErrorInfo_Interface_Support.html.
On this link you would find more information on how to style the data errors: http://help.infragistics.com/Help/Doc/WPF/2015.1/CLR4.0/html/xamDataPresenter_Styling_Data_Errors.html.
If I have misunderstood your requirements, would you please provide me with more detailed information about this functionality you want to achieve.
Please do not hesitate to let me know if you have any further questions on this matter.
I have written it clearly in the question itself. I want to mark cells with red foreground when they are changed by the user (after the initial data load).
If you still don't understand, here is the use case:
1) You open up the app, the grid loads data on form load. All foreground in black.
2) You click a cell and make some change in its value, the cell text goes red.
3) You play around elsewhere, come back and change the value of the cell to the one that was previously there, the cell foreground changes to black again.
Any more questions?
I have been looking into your issue. What I can suggest is to take a look at the following forum thread, where similar issue is discussed:
http://www.infragistics.com/community/forums/t/48810.aspx?PageIndex=1.
I am just checking if you have any further questions on this matter. Please do not hesitate to let me know if you do.