![]()  | 
 
Drag & drop between 2 treeviews | 
 
    Post Reply  
   | 
  
| Author | |
   
   iamgtd  
   
   Senior Member  
   Joined: 25 February 2009 Status: Offline Points: 131  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Topic: Drag & drop between 2 treeviewsPosted: 28 October 2009 at 6:14am  | 
 
| 
   
    
   I need help for the drag & drop operation between two CodeJock treeviews. 
 
   
  In the OLEDragDrop-event  the target treeview receives something. But I'm not able to convert this to a TreeViewNode. Please see the code. Is it necessary to do something in the OLEDragOver-Event? A sample would be great. 
private void SourceTreeView_OLEStartDrag(object sender, AxXtremeSuiteControls._DTreeViewEvents_OLEStartDragEvent e) 
{ e.allowedEffects = 1; // Copy // ------------------------------------------------------------------------------------------------------------------------------------------ // Is it necessary to use the SetData-method? // ------------------------------------------------------------------------------------------------------------------------------------------ //XtremeSuiteControls.TreeViewNode node = SourceTreeView1.SelectedItem; //e.data.Clear(); //e.data.SetData(node,???Format???); } private void TargetTreeView_OLEDragDrop(object sender, AxXtremeSuiteControls._DTreeViewEvents_OLEDragDropEvent e) 
{ XtremeSuiteControls.TreeViewNode newnode = (XtremeSuiteControls.TreeViewNode)e.data; // ------------------------------------------------------------------------------------------------------------------------------------------ // newnode is always null     // type of e.data is XtremeSuiteControls.DataObject {System.__ComObject} and the value is {System.__ComObject}.  
    // How can I convert this to a TreeViewNode? 
    // What's to do with the e.effect-value? This value is alwasy 7. 
   // ------------------------------------------------------------------------------------------------------------------------------------------ }  | 
 |
| 
   
     
     --------- 
   
  OS: Win 10 64 bit Codejock Version 22.1 ActiveX MS Visual Studio 2022 - C# ---------  | 
 |
![]()  | 
 |
    Post Reply  
   | 
  |
|       
  
  Tweet   	
    | 
 
| Forum Jump | Forum Permissions  ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum  |