Following on from http://forums.infragistics.com/forums/p/3550/18864.aspx#19703
If I change the cell value of a row that is being used in a grouped sort, and manually call RefreshSortPosition on the row, I am finding that the row position will sometimes change (depending on other sorts on the grid), but it does not move to the correct group.
I can verify it using this code:
' Update row with new data grdRow.RefreshSortPosition() ' Check to see if we should have moved group If grdRow.ParentRow IsNot Nothing Then If grdRow.ParentRow.IsGroupByRow Then ' Get the correct value from the row, for the relevant column If CStr(grdRow.Cells(CType(grdRow.ParentRow, UltraGridGroupByRow).Column).Value) <> Cstr(CType(grdRow.ParentRow, UltraGridGroupByRow).Value) Then Debug.WriteLine("Row hasn't been moved to the correct group!!!") End If End If End If
Can anyone think of a reason this would happen?
Furthermore, this does not happen on all columns. I am trying to see what is different between the columns with the problem, and those without... :-/
Ah ha!
Ok, the columns with the problem have a custom SortComparer, because they contain Integer values that are converted to text using a valuelist, and need to be sorted by the underlying value rather than the text. Why would this prevent the rows being moved to the new group when the value changes? Do I need to make use of the GroupByComparer?