Is there an example available that shows how to handle dragging a row (rows) from one hierarchical group to another, assuming the same data?
I.e. assume you are displaying customers -> products, and you want to move a product or multiple products from one customer to another.
Thanks.
Hi,
If you are using a DataSet, then you need not delete and insert. You could just modify the row(s) being dragged so that it will end up under the new parent row. Your parent/child rows are presumably using a Relationship which relies on some key data in the child row, so you could just change that field to point to the new parent row.
You will probably have to refresh the grid at that point. Something like this:
grid.Rows.Refresh(ReloadData, true)
I haven't really dug into the problem yet...I was just looking for a sample. I assume the way to handle is basically the same as your published example of a drag and drop within the same level, except instead of moving the selecting rows I'll be deleting and inserting. By deleting and inserting, the child parent relationships are correctly maintained. Or should the grid be handling that based on the relationships defined in the grid source, which is a dataset?
I'm not aware of any samples exactly like this. It would be hard to make a sample of this since moving a row to a new parent would mean modifying the data.It would depend a lot on what kind of data source you are using.
What part of this is giving you trouble?