LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tree Control Drag/Drop Specific Nodes?

Hi all,

I'm trying to get advanced functionality out of the tree control in LV8.  I want the user to be able to drag nodes around in the tree to reorder them, but I'd like to be able to define which nodes in my tree can be dragged where.

For example, consider the tree:

-Breakfast
    -Eggs
    -Bacon
-Lunch
    -Club Sandwich
    -Hamburger
-Dinner
    -Fried Chicken
    -Steak

I'm trying to find a way that the individual "food nodes" can be dragged and dropped under any other food category, but not by itself or as a child of another node.  The main food categories (breakfast, lunch, dinner) shouldn't move at all in the tree.

I currently can filter out the events for the "food categories" but using the "Drag Starting?" filter event and then check the node's tag and use the "disable event" terminal appropriately to throw out the drag event.

However, is there a way to define where a node *can* or *can't* be dropped?  There's no "Drag Ending?" filter event that I can throw out the drop event if it's not at a correct node.

I'm running out of ideas...  Has anyone done anything like this or has any suggestions that I can use?

Thanks in advance!

~Jeff
0 Kudos
Message 1 of 2
(2,818 Views)

Jeff,

I think your question is addressed exactly in this excellent post, which was actually responded to by the developer of the new drag and drop functionality in LabVIEW 8. The short answer is that it is certainly possible!

Kind Regards,
E. Sulzer
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,792 Views)