CancelDrag Problems

3 posts, 1 answers
  1. Stephen
    Stephen avatar
    24 posts
    Member since:
    May 2011

    Posted 19 May 2011 Link to this post

    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. Answer
    Tsvyatko
    Admin
    Tsvyatko avatar
    832 posts

    Posted 20 May 2011 Link to this post

    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
  3. DevCraft banner
  4. Stephen
    Stephen avatar
    24 posts
    Member since:
    May 2011

    Posted 23 May 2011 Link to this post

    That works beautifully. Thank you!
Back to Top