Hello,
I am using UltraDataSource with UltraGrid.
I have a number of rows in the data source, with the values being updated on the fly.
The problem I am experiencing is that whenever I update a single value in a data row, the entire row is refreshed (all cells repainted).
Is there a way to make the UltraGrid repaint only the cell whose value changed, and not the row?
Thanks,Andrey
Hi Andrey,
I don't think there is any way to stop this. The idea is that when you a single value in a row is changed, the grid fires InitializeRow for that row. This allows you to do things like color an entire row based on the row value.
Hi Mike,
Thanks for the clarification.
It would be a good enhancement if this behaviour could be configured (i.e. I want only the cell which value changes to refresh).
This would allow implementing even better "high-performance" grids.
I checked into this a little deeper and I am told that I am wrong and that the grid was updated to only invalidate the cell. Perhaps you are using an older version of the grid from before this change was made? What version do you have? Do you have the latest Hot Fix?
Also, currently the grid seems to exchibid some strange behaviour...
Imagine I have a hierarchical UltraDataSource with two levels of data.
Now I start continuously updating the values of the cells on all levels...
The topmost band always refreshes the entire row.
The child bands refresh the entire row when a cell within a flat band region is selected.
The child bands refresh only updates cell when no cells selected within a flat band region.
I'm afraid that I really have no idea what version the change was made in. You can check the Infragistics web site and see if there is a hot fix available: My Infragistics Keys and Downloads - Download Anything and Everything You Own
Using .NET Reflector I have been able to identify the piece of code which causes the entire row to refresh...
In the UltraGridBand.DataSource_ItemChanged(object sender, ItemChangedEventArgs ea){ ... UltraGridRow rowWithListIndex = currentParentRows.GetRowWithListIndex(ea.Index); if (rowWithListIndex != null) { rowWithListIndex.ParentCollection.NotifyCalcManager_ValueChanged(rowWithListIndex); rowWithListIndex.FireInitializeRow(); if (!(this.lastBoundList is IUltraDataRowsCollection)) {// >>>> THIS IS THE CALL WHICH CAUSES THE ROW TO REFRESH <<<<<< // rowWithListIndex.InvalidateItemAllRegions(); } } ...}
As I said before, I simply bind a hierarchical UltraDataSource to the UltraGrid and begin updating values in the data source....
Please let me know if from here you can derive any way of preventing the entire rows to refresh?
I'm not sure why the code is doing that. It seems like this needs to be looked into, though. I recommend that you Submit an incident to Infragistics Developer Support.
Include a link to this forum thread so they can see the discussion so far. This needs to be written up for developer review.