We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Drag and drop in treeview

Hi,

I have the following requirement regd drag and drop feature in syncfusion treeview.

1. Drag and drop should be allowed from Treeview1 to Treeview2 but not vice versa. This is achieved.

Can you provide any solution for the below one
2.Drag and drop should not be allowed within the same treeview.

Saw an example in Drag and Drop feature in the site in which the following is given in the clientside function.

function DropNodeToTree2FromTree1(eNode)
{

if(eNode.SourceNode.ParentTreeView.id! =eNode.TargetNode.ParentTreeView.id)
{

}
}


eNode.SourceNode.ParentTreeView.id and eNode.TargetNode.ParentTreeView.id are not returning anything. How to get the treeview id of the source and target node so that if both the id's are same (means they belong to same treeview) then i can stop dropping it.

Note: Version of Syncfusion is 5.102.0.51

Thanks
Neeraja

2 Replies

GB Gokul B Syncfusion Team June 26, 2007 08:47 PM UTC

Hi Neeraja,

We can able to reproduce the issue as you mentioned. We noticed that Source and target node ID of the treeview could not be retrieved trough client side while droping.

It seems to be a bug. Could you please open a new Direct-Trac incident with "Forum ID- Forum Subject" as a subject line to proceed towards the bug fix.

Please have a look at the below code snippet if you need to disable the node DragandDrop for a treeview.

//Disable the node drag and drop
TreeView1.DragAndDropEnabled=false;

Thanks for using Syncfusion product.

Regards,
Gokulkumar B


LD Lakshmi Duvvuri June 27, 2007 06:55 AM UTC


Hi Gokulkumar,

Thanks for the update. I have posted it as a new incident in direct trac

Here, TreeView1.DragAndDropEnabled=false is not a solution as this will totally disable the drag and drop feature in treeview1. But we require drag and drop from treeview1 to treeview2 but not from treeview1 to treeview1(i.e within the same treeview drag and drop should not happen)

Thanks,
Neeraja




>Hi Neeraja,

We can able to reproduce the issue as you mentioned. We noticed that Source and target node ID of the treeview could not be retrieved trough client side while droping.

It seems to be a bug. Could you please open a new Direct-Trac incident with "Forum ID- Forum Subject" as a subject line to proceed towards the bug fix.

Please have a look at the below code snippet if you need to disable the node DragandDrop for a treeview.

//Disable the node drag and drop
TreeView1.DragAndDropEnabled=false;

Thanks for using Syncfusion product.

Regards,
Gokulkumar B

Loader.
Live Chat Icon For mobile
Up arrow icon