Home - Forums-.NET - FlyTreeView (ASP.NET) - Dynamically Assign DragDropName / DragDropAcceptNames

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Dynamically Assign DragDropName / DragDropAcceptNames
Link Posted: 08-May-2006 09:35
I've got two treeviews:



                                                              PostBackOnDropAccept=\"true\"
                                PostBackOnClick=\"true\"                                                      
                                BackColor=\"beige\"
                                BorderColor=\"black\"
                                BorderStyle=\"solid\"
                                BorderWidth=\"1\"
                                Width=\"100%\"                                                                                          
                               />  

                                                            PostBackOnDropAccept=\"true\"
                                PostBackOnClick=\"true\"                            
                                BackColor=\"beige\"
                                BorderColor=\"black\"
                                BorderStyle=\"solid\"
                                BorderWidth=\"1\"
                                Width=\"100%\"                                                                                                                                                          
                              />



Background:

FTV1 is a dynamically populated tree consiting of a root node, and some numer (N) child-leaf nodes. (there are only 2 levels to this tree, root and child-leafs)


  
  
  
   ...


FTV2 is a dynamucally populated tree consiting of a root node, and some number (N) child nodes.  For each child node there are some number (X) child-leaf nodes.


    
        
        
        
         ...
    
    
        
        
         ...
    
     ...


What I want to do:

- FTV1 should only accept items from FTV2.  These items should only be dropped under the  node. (e.g. no child-leaf should be able to accept a child) Furthermore, these nodes should originate only from the  nodes of FTV2.
  
- FTV2 should only accept items from FTV1.  These items should only be dropped under  nodes.  (e.g. the  node should not accept any newly dropped nodes)

- The  node in either tree should not be draggable.
-  nodes, in FTV2, should not be draggable.

The Problem:

It does not appear that dynamically assigning the DragDropAcceptNames is functioning as I understand it should.  If I set this property for the entire tree, from within the ASPX page, drag-drop works fine.  

Given that the property is available at run-time, I would expect to be able to assign a DragDropName to each leaf node (e.g. \"childleaf\") and a DragDropAcceptNames to each node that I want to accept \"childleaf\" nodes as described above ( for FTV1 and each  for FTV2)

can you please clarify how this functionalty works?  If anything is unclear in my post, please let me know and I shall try to clearify.

-Josh

[/u]
Link Posted: 08-May-2006 11:53
Josh,

I've created the following code:

            
                
                    
                        
                        
                        
                    
                
            
            
                
                    
                        
                            
                            
                        
                        
                            
                            
                        
                    
                
            


Also, the Drad-and-Drop functionality seems to be broken in the last several builds (since we've merged many changes into FlyTreeView).
It is now finally fixed (I hope so).

The code above now works for me. And it seems to be what you need.
Link Posted: 08-May-2006 12:11
Should the same logic also work for dynamically populated nodes?

I walk through a dataset to populate the tree.  As I create nodes, I should be able to assign the dragdropname and dragdropacceptnames properties to each node and achieve the same functionality, correct?  The functions which populate the two trees are called from page_load - this shouldn't be a problem should it?

I will play with this some more tommorow and let you know what I come up with.  Thank you so much for your excellent support in this forum.

-Josh
Link Posted: 08-May-2006 13:13
There's no difference in the way how you set nodes properties.
It should work in any case.
Link Posted: 09-May-2006 03:48
This functionality works perfect now.

Thanks!

-Josh