TreeView_DragDrop event not working.

3 posts, 0 answers
  1. Raj Sharma
    Raj Sharma avatar
    7 posts
    Member since:
    Jan 2010

    Posted 12 Feb 2010 Link to this post


    I have control inherited from RadTreeView.

    In my constructor i have set

     

    AllowDragDrop =

    true;

     

    void

     

    TreeView_ItemDrag(object sender, RadTreeViewEventArgs e)

     

    {

     

       //Does nothing

     

    }

     

    void

     

    TreeView_DragEnter(object sender, DragEventArgs e)

     

    {

    e.Effect =

    DragDropEffects.Move;

     

    }

     

    void

     

    TreeView_DragDrop(object sender, DragEventArgs e)
    {
      //My business logic....
    }

    TreeView_DragDrop even is never get executed when i drop a RadTreeNode before/after another RadTreeNode in the view.

    Please help...

     

  2. Raj Sharma
    Raj Sharma avatar
    7 posts
    Member since:
    Jan 2010

    Posted 12 Feb 2010 Link to this post

    I also found that if i add below code then the system do execute the TreeView_DragDrop(object sender, DragEventArgs e) event

     

     

    void TreeView_ItemDrag(object sender, RadTreeViewEventArgs e)

     

    {

         DoDragDrop(e.Node, DragDropEffects.Move);

     

    }

    But this do not solve the problems as now i do not get the Line while dragging and also the RadTreeNode which I am dragging is not shown moving in RadTreeView.

    Cheers,
    Raj

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 15 Feb 2010 Link to this post

    Hi Raj Sharma,

    Thank you for writing. Please do not mix standard OLE drag & drop method calls with the automatic drag & drop that RadTreeView provides. The DoDragDrop() method is a .NET method (not provided by Telerik) and is not guaranteed to work with Telerik controls in all cases. When you call DoDragDrop(), the method installs a modal message loop which handles all WM_MOUSEMOVE events and none get to RadTreeView, this is why you have no line. 

    The OLE Drag & Drop events, methods and properties, which are members of Control are:

    AllowDrop,
    DragEnter,
    DragLeave,
    DragOver,
    GiveFeedBack,
    QueryContinueDrag,
    DoDragDrop()

    RadTreeView drag & drop events and properties are:

    DragEnding,
    DragEnded,
    DragOverNode,
    DragStarted,
    DragStarting,
    AllowDragDrop,
    AllowDragDropBetweenTreeViews

    Please choose which mechanism you will use and use it consistently. Write again if you have other questions.

    Best wishes,

    Victor
    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.
Back to Top