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

Treeview Drag and Drop Required first click to select Node

1 Answer 123 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
SANJAY
Top achievements
Rank 1
SANJAY asked on 19 Sep 2012, 05:55 AM
Hi All,

I have Treeview in my project with "multiSelect" property to true. I have enable drag and drop for my Treeview. But my issue is, before drag and drop the node I need to click the node to select unlike windows file system you can just drag and drop particular file without first selecting it.

When I take mouse hover to node (which is not selected) and push and hold the left button and trying to drag, it will just select the node and not dragging the node.

Please help me to find out what wrong with that?

Thanks

1 Answer, 1 is accepted

Sort by
0
Svett
Telerik team
answered on 21 Sep 2012, 01:10 PM
Hello Sanjay,

Your question has already been answered in the other thread you have opened. Please, see our answer there for more information.

We kindly ask you to use just one support channel to contact us. Posting the same questions more than once slows down our response time because we will need to review and address two or more tickets instead of one. Moreover, support threads are handled according to license and time of posting, so if it is an urgent issue, we suggest that you use a support ticket, which would be handled before a forum thread.

Thank you for your understanding.

Greetings,
Svett
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Pascal
Top achievements
Rank 1
Iron
commented on 12 Jul 2023, 12:14 PM

Hello! I'm interested in the solution of the other thread. Sadly the link is broken. Is there another link I can use to get to the other thread or to its information?
Dess | Tech Support Engineer, Principal
Telerik team
commented on 17 Jul 2023, 06:59 AM | edited

Hi, Pascal, Note that with the latest version of RadTreeView in unbound  mode the drag and drop operation is initiated as soon as you start dragging the node even if it is not previously selected:

In case you are using bound mode, the drag and drop operation is not supported out of the box and the developer should implement the desired behavior according to the specific DataSource collection. A sample approach is demonstrated here:

https://docs.telerik.com/devtools/winforms/controls/treeview/drag-and-drop/drag-and-drop-in-bound-mode 

https://docs.telerik.com/devtools/winforms/controls/treeview/drag-and-drop/modify-the-dragdropservice-behavior 

You can further extend the behavior and start the service in the ProcessMouseDown method of the RadTreeViewElement. Please give this approach a try and see how it works on your end.

 

Pascal
Top achievements
Rank 1
Iron
commented on 28 Jul 2023, 09:41 AM

Thank you a lot!

I implemented this to my already existing custom TreeViewElement and it works well.

protected override bool ProcessMouseDown(MouseEventArgs e)
{
    var result = base.ProcessMouseDown(e);
    
    var nodeElementAt = GetNodeElementAt(e.Location);
    DragDropService.Start(nodeElementAt);

    return result;
}

Tags
Treeview
Asked by
SANJAY
Top achievements
Rank 1
Answers by
Svett
Telerik team
Share this question
or