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

CancelDrag Problems

2 Answers 38 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 20 May 2011, 01:35 AM
I am attempting to drag items from the RadTreeView to the RadScheduler. I do not want users to be able to drag items at the first level of the tree, so I attached a handler to the DragStarted event of the RadTreeView. Within that handler, I am checking the item being dragged, and if I don't want to allow dragging, I call RadDragAndDropManager.CancelDrag(). This is the same method used in the Scheduler drag and drop example. However, whenever CancelDrag gets called, it is causing the entire application to freeze. This appears to be the case in the example as well. You can drag items that are below the first level, but if you try to drag items at the first level, the application freezes. Please help me find a solution to this problem.

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Tsvyatko
Telerik team
answered on 20 May 2011, 12:22 PM
Hello Stephen,

 Thank you for reporting this issue. We will fix this in one of our next internal builds. Meanwhile, you can use PreviewDragStarted event instead:

private void RadTreeView_PreviewDragStarted(object sender, Telerik.Windows.Controls.RadTreeViewDragEventArgs e)
{
       ....
   if([your condition])
  {
    RadDragAndDropManager.CancelDrag();
    e.Handled = true;
    return;
    }
    .....
}

Please, excuse us for the inconvenience caused.


Regards,
Tsvyatko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Stephen
Top achievements
Rank 1
answered on 23 May 2011, 09:09 PM
That works beautifully. Thank you!
Tags
DragAndDrop
Asked by
Stephen
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Stephen
Top achievements
Rank 1
Share this question
or