Hi, I'm currently evaluating your product and one of the things I need it to do is display realtime information while allowing the user to group and sort. I'm currently using the UltraDataSource to manually update the cells as changes occur to the data (any better ideas?). Currently however, when I group by a field that changes, the items within those groups don't change groups. The same is for sorting, the sort order doesn't change (as expected). I realize that requiring the control to regroup and resort is expensive and probably something that it doesn't do without being told to. I've researched the methods and properties on the grid and have explored the forums for an answer without any luck. Any ideas?
-mt
There is no such thing as a pure unbound mode with the WinGrid. Is there a particular reason that you can't simply update the row in the grid directly instead of the underlying UltraDataRow? This would be the ideal way since then you're being consistent with updating the grid from one place instead of two.
-Matt
I thought of that as well, but it doesn't look like the AfterRowUpdate event is fired when I call SetCellValue. I figured it would only fire when the row update comes from the user, instead of from the data source.
I did enumerate over the group rows and saved the state before the cell update, then restored the state after the cell update, but this felt like a hack and even so, still behaves strangely as the scroll position, selected row, etc. are being reset as well.
Any other ideas? Maybe I shouldn't be using the UltraDataSource to update my values. Would operating in a pure unbound mode help any?
There's no way to get the corresponding UltraGridRow from the UltraDataRow without looping through the Rows collection. What you might be able to do is set a flag before the SetCellValue call and listen for the AfterRowUpdate, which will give you the row that was updated. You would then reset the flag after the SetCellValue method completes.
Yeah, I just realized how to change the default search date range on the forums so I was able to find this:
http://forums.infragistics.com/forums/p/6699/28304.aspx#28304
Which indicates the same solution you've proposed. I need the group states to remain the same, and I see in the above post that you refresh the sort position of an individual row.
My problem now is how can I obtain the UltraGridRow instance that corresponds to the row I'm updating when I call:
ultraDataSource.Rows[index].SetCellValue(key, newValue, true);
You should be able to use the RefreshSort method off of the SortedColumns collection of a band in order to refresh the grouping/sorting.