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
35
Visual Update notification
posted

I'm looking for a way of visually notifying cell updates. What I have now is a BindingList<MyBusinessObject> which satisfies INotifyPropertyChange. This works fine when a value is changed outside the grid. Now what I'd like to do is to change the colour of cells that have their a value changed in this way. I know I can use AfterCellUpdate (or something similar) with the grid but that is only fired when the user changes the value and not when the underlying data is changed from the outside.

 Any ideas?

  • 990
    posted

    Hi,

    As long as your data supports INotifyPropertyChange then you should be able to use the ValueBasedAppearance property of the Column in question.

    If you haven't seen it before it's in the UltraWinGrid Designer under Band and Column Settings/Band[yourBand]/Columns, select the required Column then look near the bottom of the property list.

    Andy.

  • 37774
    posted

    I think that the only event that will fire in this case is InitializeRow, so you could certainly change the appearance here; the problem is, naturally, that there is no way of distinguishing which cell has caused the reinitialization.  You might have to listen to the PropertyChanged event of your data source so that you can keep track of which cells have changed and then check those in InitializeRow.  One approach would be to store the new value and the column key (i.e. in a Dictionary/Hashtable) and then look that up in InitializeRow

    Perhaps someone else has more experience with doing this, or perhaps I'm also missing something obvious :-)

    -Matt