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

Disable automatic moving of items

1 Answer 15 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Scott Waye
Top achievements
Rank 1
Veteran
Scott Waye asked on 20 Dec 2011, 09:50 PM
Hi,

Im using the DropQueryEvent and DropInfoEvent in my tree view to enable drag/drop of nodes.  It works fine and the items move ok, but when items are dropped I execute some database operations and in the case where these operations fail, I do not want the item to be moved.  I am happy to do the moving of tree nodes myself when the database operation completes, but to do that I need to disable the built in mechanism.  Is it possible?

Thanks,

Scott

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 23 Dec 2011, 04:49 PM
Hi Scott,

The RadTreeView control has a built-in drag/drop functionality that exposes a number of events that allow you to customize it. You can find more info here. In your case you can handle the PreviewDragEnded event to stop the drop operation and implement your database-related logic. And then manually move the tree node per your requirements.

Please give this approach a  try and let me know if it works for you or if I'm missing something.

Greetings,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
TreeView
Asked by
Scott Waye
Top achievements
Rank 1
Veteran
Answers by
Tina Stancheva
Telerik team
Share this question
or