I'm have a single TreeViewAdv and need to allow or disallow a node being move based on the node being dragged and where it is being dropped. I "carry" the node type in the tag. The problem I'm having is that when I get the DragOver or DragDrop events I can't get the data from e.Data.GetData. I always get a null. I thought the object would be of type TreeNodeAdv but I get null back. I also tried object and a string with a conversion to see if I could get something but that didn't work either.
ADAdministrator Syncfusion Team August 14, 2003 01:08 PM
You can use code given below to accomplish this.
private void treeViewAdv2_DragOver(object sender, System.Windows.Forms.DragEventArgs e)
TreeNodeAdv tnas = e.Data.GetData(typeof(TreeNodeAdv)) as TreeNodeAdv;
The e.Data.GetData method here returns an array of TreeNodeAdv and not just a single TreeNodeAdv. This is done to take care of situations in which multiple nodes maybe dragged/dropped.
Let me know if this is the information you are looking for.
RIRickAugust 19, 2003 09:35 PM
That did it. Thanks!
CSChidd StoneMarch 2, 2007 10:32 AM
I tried using this line code in the DragOver event: nodesBeingDragged = e.Data.GetData(typeof(TreeNodeAdv)) as TreeNodeAdv;
but it returns null: Quick watch in VS2003 shows only one TreeNodeAdv in the data although I select multiple nodes. Have set property SelectionMode to MultiSelectSameLevel but have I forgotten something? (Syncfusion 22.214.171.124) Any help appreciated Chidd
MUMurugan Syncfusion Team March 2, 2007 04:33 PM
Herewith I have attached the sample for your requirement. Please refer to the sample and let me know if it helps you.