Hello,
I am working with a UltraWinGrid and UltraDataSource. The requirement is that anytime a value in the grid changes, the grid cell appearance (backcolor/forecolor) changes. What is the best way to do this using Infragistics? Is there a design pattern I could follow?
The solution I have is to remember values that have changed before update the UltraDataSource row, and then to use this data structure to set the appropriate appearance (dirty/clean) in the InitializeRow event of the UltraWinGrid. Then, call RefreshRow on the "changed" UltraWinGrid rows when the value is no longer considered dirty. This feels a bit hacky to me, but it works.
Another idea: Add a column or columns to the UltraDataSource storing the "dirty status" of the UltraWinGrid cells, and perform similar logic in the InitializeRow event. This solution avoided the "Refresh" iterations when trying to un-dirty a cell, but it bloats my UltraDataSource with extra columns.
Am I missing something?
Thanks, Steve
UltraGridRow and UltraGridCell both expose a DataChanged property, which basically returns whether there are any changes pending.
Hi Brian,
Thank you for the response, I appreciate it. I don't think the DataChanged property is what I am looking for, as I am programmatically making changes to the DataSource and not the UltraWinGrid. So, in InitializeRow (when I need to color a cell as "changed" or "normal"), the DataChanged property is always false.
As I mentioned in the original post, I have the functionality working, and I am just wondering if there is a better way to do it.
What would be really neat is... if there was a way on the grid to specify a "changed" appearance for when a cell value changes, and then some sort of mechanism for expiring the "changed" appearance. It would be even neater to add some animation support into the grid to allow a "dirty" cell to fade back to the normal appearance.
Thanks! Steve