I have a grid that is grouped by a column. I also have allowed data to be pasted from another source. Now, if the data is pasted in one of the groupby rows, then AddNewRow() always adds rows to the last. Is there a way to intuitively paste data in the same group ?
Any help is appreciated!
I got it., it is the re-sort thing that i was missing.
Hi,
I'm a little unclear on exactly what you are doing or how you are adding the rows. The grid itself doesn't have any way to allow you to add a row under a particular GroupByRow directly. You add rows to the Band, not to the rows collection.
But assuming that the new rows data meets the criteria for a particular group, you could add the row and then refresh the grouping to put that row into it's correct place.
You can re-sort (and re-group) a single row by calling:
row.RefreshSortPosition();
Or, you can refresh the entire band like so:
this.ultraGrid1.DisplayLayout.Bands[0].SortedColumns.RefreshSort(true);