Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
75
Cell Appearance changes / Bindings / Property Changes
posted

 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.  

Parents
  • 469350
    Verified Answer
    Offline posted

    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)

Reply Children
No Data