How to make possible drag and drop rows when the SortedColumns.Count>0
regards,
pgr2007
Hi,
Thanks for the reply
I tried with
aRow.ParentCollection.Move(aRow, dropIndex);
it is now working for both situation.
thanks a lot
Okay, the problem is with the call to the Move method:
ultraGrid1.Rows.Move(aRow, dropIndex);
This is assuming that the row is in the root-level rows collection of the grid. Try this instead:
aRow.ParentRowsCollection.Move(aRow, dropIndex);
I can't see any reason why dragging and dropping within the same group should not work. Is the Move method gettings called? Is it being called using the Rows collection that the row actually belongs to?
HI,
Thanks for the reply.
Actually I don't need drag drop outside the group.
But needed inside the group and that is not possible
The sample is using the Move method on the Rows collection. If you are trying to drag a row from one group to another, then this will not work, because the rows collection the row is currently in is not the same one you will be moving it to. The Move method can only move a row to a new position within the rows collection in which the row already exists. You can't use Move to move a row from one rows collection to another. In any case, moving a group from one group to another involves more than just moving the row. In order for the row to be moved to a new group, the value of the cell or cells that it is grouping by would have to be changed so that the row now belongs to the new group. So what you would have to do in a case like this is first change the value in the cell so that the row belongs to the new group. Then refresh the groupings on the grid to move the row to the new group. I think you can just call RefreshSortPosition on the row to handle this. Then you could call Move to position the row at the index you want it.