Hi,
I've got a Grid bound to a BindingSource, which itself is bound to a DataTable (there's also a filter on the BindingSource). There's a Outlook-style Grouping against one of the columns on the Grid - let's call it Status. In addition, that column is using a ValueList to resolve an id field to string literals. It all works great.
However, if I programmatically update the data on the column by which I'm grouping by (Status), the Grid does not move the edited row into the correct group - it just stays where it was. I have confirmed that the data is correctly getting updated, and if I remove the GroupBy in the Grid, so that the column shows up in the rows as normal, I then see the cell changing value correctly - it's just the Grouping that's not working correctly.
I've tried refreshing the BindingSource and also the Grid (using Rows.Refresh) but it made no difference.
Any ideas?
Thanks
Isaac
Hi Qube,
I experienced similar problems.
I found that hooking into the grid's InitializeRow event and simply calling RefreshSortPosition on the row being initialized solves all my problems. I'm still having problems with the grid throwing NullReferenceException, particularly in a method called VerifyChildElements - do you know anything about that?
Washier
Qube said:My question is: Is there a better, more reliable way to find the new UltraGridRow?
The way you are doing it seems fine to me.
Mike Saltzman"]I think a better way to do this would be to add the row to the grid's DataSource, rather than through the grid
Thanks Mike. I switched to adding a DataRowView to the underlying BindingSource, rather than an UltraGridRow to the UltraGrid. It does seem to be a better solution for programatically adding rows.
Because the new row starts with an empty value in the group column, a new UltraGridGroupByRow is created with a blank value. To locate the new UltraGridRow and call its RefreshSortPosition, I use the following code:
Dim objRow As UltraGridRow = Me.UltraGridX.GetRow(ChildRow.First).GetChild(ChildRow.Last)objRow.RefreshSortPosition()
GetRow(ChildRow.First) gives me the new UltraGridGroupByRow with a blank value. GetChild(ChildRow.Last) gives me the most recently added UltraGridRow to that group.
My question is: Is there a better, more reliable way to find the new UltraGridRow?
Hi Campbell,
I'm not aware of any, but you would be better off asking Developer Support. They're more aware of these things that I am.
Hi Mike,
I actually have a very similar issue to this, but I am using the RefreshSortPosition. Now, normally, this works fine. However, occasionally the data will update and I see the updates in the grid and verify the changes in the datatable. However, the RefreshSortPosition is not moving the row into the correct group.
I tried your suggestion of SortedColumns.RefreshSort(True), however, this very frustratingly collapses all of the groups (altho it does move the row to the correct group).
Do you know if there are any oustanding issues on this functionality? I'm using 7.3.1043.
Thanks,Campbell