I'm sure this is a simple thing but of course my problem doesn't match anything I've found on the internet.
Have an UltraGrid bound to a binding source whos datasource is a custom list (an IBindingList). Properties of the items in the list notify of their property changes.
When a cell changes, the underlying object has a flag "isModified" set to true, which is checked in the CellChanged event. That colors the background of the row yellow.
We save modifications to the list all at once (on a button click). A fiew properties are modified on the item during the save process, and these ARE reflected back to the grid properly.
However, danged if I can get the row reset back to its normal background color. When those cells change due to the property events, there isn't a cellchange event on the grid, nor an initializerow. I need a place to check the isModified property to set.
I've tried setting the datasource to nothing and back to the list returned from the save method. I've tried clearing it first. I've tried Application.DoEvents(). I've tried UltraGrid1.Refresh()..
I will admit there is background processing going on, but not on this save. The grid is initially populated through a backgroundworker, but the list attached to the datasource is only updated through the progressreported method. I'm pretty sure I'm keeping my threads separate.
Anyone have any hints on something I haven't tried? It's like the datasource isn't seeing the item changes, because the list object is the same.
Thanks! That's the key I needed - I've used that refresh method when I've been on an individual row, but didn't realize it would fire all rows from one call if I used it from the row collection. Now all I have to do is fix the way I color my cells (found another of your posts Mike about cell appearance tricks) and I think this will work.
If it wre me, I probably would not use CellChanged to set the appearance of the row. Use InitializeRow, instead. Then, when you commit your changes and you want to refresh the grid, all you have to do is called grid.Rows.Refresh(FireInitializeRow).