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

Prevent drag & drop selectively

2 Answers 54 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Karanjit Siyan
Top achievements
Rank 1
Karanjit Siyan asked on 10 Jan 2011, 02:24 PM
I want some sample code that shows how to selectively prevent drag of nodes in a  RadTreeView. That is, if I have some property in a a business object behind the RadTreeView such as "bool PreventDrag {get; set;}", then if this property  is set to true, the drag of that tree node should be prevented. If the property is set to false, then it should be possible to drag. I tired to do this by setting the IsDragDropEnabled property of the RadTreeView at run time when a new tree view item is selected but this does not work by changing at run time.

I know how to prevent drop in a region once drag has started. However, I am looking for a way to prevent the drag from starting in the first place.

Thanks,
Karanjit

2 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 11 Jan 2011, 11:32 AM
Hello Karanjit Siyan,

Please, check the attached project.

Let me know if you have any further questions.

Kind regards,
Tsvyatko
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Karanjit Siyan
Top achievements
Rank 1
answered on 11 Jan 2011, 01:25 PM
Thank you very much.

I had to adapt it quite a bit to my application but it now works like a charm! Thank you again for your quick and rapid response. Very impressive!

Karanjit
Tags
DragAndDrop
Asked by
Karanjit Siyan
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Karanjit Siyan
Top achievements
Rank 1
Share this question
or