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
Thank you I looked all over for a flag and never saw that one.
Hi,
I think you need to set the AddRowModifiedByUser flag on the rows collection. This will tell the grid to treat the TemplateAddRow as though the user edited it.
I have a similar problem only I want to tell the grid that the row/cell is dirty.
When a cell is being added I have a cell button style on a column. When it is clicked some data is selected and I populate the proper cells with data. When the user presses enter the add row just sits there as if the data is not dirty. I have to tab to a cell whose data I did not set and modify it in order to get the row added.
What is the best way to populate a new row with data and still have the grid add it when the return key is hit if no other cells in the row are modified.
AddRow is a fixed row at the bottom
I have same requirement in my project. i want to change cell's back color , when value is changed in the cell.
AfterCellUpdate event is working fine for me.
Having a very similar problem and I solve(?) it by using a local cache (hashtable is sufficient for my purposes). I query and populate it from CellDataRequested and also set appearances from there. Seems a bit wrong but it does work.
I undirty the cells after a duration or a user click/acknowledgement, etc.
When not using the UltraDataSource and binding directly (albeit via the BindingSouce) to my business objects I actually maintain a hashtable of monitored and changed properties (I don't care about values - i just want to know that the property has changed) within the objects themselves. I can then use these in the initializerow to set appearances.
My systems a real-time distributed with objects being replaced/inserted/deleted on the fly rather than on user request - i mention this because my solutions generally need to be a little more complex than the norm so you should always look for the simpler solutions first.
hth