I guess my first question should be, when I bind to a BindingList of objects that implement INotifyPropertyChanged, and the PropertyChanged event gets fired, should this be invalidating the entire viewable grid or only the row that fired it?
My current implementation is updating a grid using an event that call UltraGridRow.Refresh() after a property has changed, but this will not update any summaries i have in my grid. A call to SummarySetting.Refresh() causes UI hickups when i call them every second( i have about 15 summarie ). I was hoping that implementing INotifyPropertyChanged would aleviate the need to call SummarySetting.Refresh() (it has) but it has also slowed the performance of my realtime data grid down to the point where it has become unsuable because the entire viewable are of my grid is being invalidated with each PropertyChanged event that gets fired.
Any ideas?
Thanks,
-Steve
Hi Stephen,
The grid doesn't know anything about INotifyPropertyChanged. If this is having any effect at all, it must be because the BindingManager is looking for this and firing ListChanged notifications to the grid.the grid should only be refreshing what it needs to, but this is based on the notifications it is getting. If the BindingManager is sending a Reset notification, then the grid has to throw away the whole layout and re-build everything. If if's just an ItemChanged, then the grid would only refresh the individual row and the summaries affected by the values in that row.
There are probably ways you can make your grid more efficient, but it's really hard to say what they might be without knowing exactly what features of the grid you are using.
One thing you may want to do is check out the CellDisplayStyle property on the column. this property allows you turn off certain features of a column that you know you are not using.
Another thing to do would be to wrap your updating code inside a BeginUpdate/EndUpdate block. This will stop the grid from painting during the update, so you can potentially reduce multiple paint operations down to one.
I captured the ListChanged events that are being fired by the BindingList that I am binding to, and I only got one or two Reset notifications. The majority were all ItemChanged notifications and the enitre viewable area of my grid is still being invalidated.
To make sure I wasn't missing something i switched back over to my event that was calling UltraGridRow.Refresh() and that was only Invalidating the row that was being refreshed. Performance was fine this way, even though multiple paints were happening within a second.
Could it be the summary update is invalidating the grid event though only an ItemChanged notification is being thrown?
I'm not sure. I would think that an ItemChange notification would onyl invalidate the row that is updated. The summaries make this more complicated, though, and I imagine that the rects are unioned together so it would be a pretty big rect, if not the whole grid.
If you feel that the grid is invalidating more than it needs to, then your best bet is to create a small sample project demonstrating this and Submit an incident to Infragistics Developer Support. Perhaps there is some better way the grid can be optimized to handle this.