This is a migrated thread and some comments may be shown as answers.

Drag and drop with self-referencing heirarchy

2 Answers 101 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Julian
Top achievements
Rank 1
Julian asked on 17 Oct 2011, 01:59 PM
Hi All, I'm using the grid and this example

http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/selfreferencing/defaultvb.aspx

I'm also allowing drag and drop. Items can be dragged above or below another item, but not on top of. My goal is to drag one item on top of another so that I can set the parent/child relationship. In the example above, I'd want to set EmployeeID=7 to be a child of EmployeeID=3. Can this be done?

2 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 20 Oct 2011, 07:24 AM
Hello Julian,

When you drop a grid item over another grid item you are always dropping it "on top". It doesn't matter if the row drop indicator shows above or below the target item, you know which item you are dropping on. In the server-side RowDrop event handler, you can retrieve the target item from the event arguments object and update your dragged item's parent key value accordingly.

Veli
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Julian
Top achievements
Rank 1
answered on 20 Oct 2011, 04:59 PM
Thanks!
Tags
Grid
Asked by
Julian
Top achievements
Rank 1
Answers by
Veli
Telerik team
Julian
Top achievements
Rank 1
Share this question
or