LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I only drag items in between items in a tree

Hi,

 

I'm using LabView 2011.  I am using a tree and I want the user to be able to reorganize it.  The parent is called "test #" and it can have unlimited children called "step #".  Test needs to always be the uppermost parent and step always needs to be a child of a test.

 

A tree may look like this:

 

Test 1

 - Step 1

 - Step 2

Test 2

 - Step 1

Test 3

 - Step 1

 - Step 2

 - Step 3

 

Etc...

 

What I want the user to do is be able to grab a test and reorder it.  For example, I want test 1 to be able to go behind test 2 to look like this:

 

Test 2

 - Step 1

Test 1

 - Step 1

 - Step 2

Test 3

 - Step 1

 - Step 2

 - Step 3

 

I only want dropping between items, not in items.

 

How can I do accomplish this?

 

Thanks.

0 Kudos
Message 1 of 3
(2,796 Views)

I haven't received an answer yet.  If someone needs this to be expalined better or has any questions, I'll gladly give more info.

0 Kudos
Message 2 of 3
(2,769 Views)

Hey Biscuit!

 

Sorry for the long response time.

Dragging and dropping in your tree menu is entirely possible.

 

I'm assuming you're using the tree as a control.

 

In the block diagram, right-click on the tree icon, and create a property node

(Right click -> Create -> Property Node -> Drag/Drop -> Allow Item Drag)

 

You'll want to expand the property node to allow space for several properties to fine-tune the behavior.  I've attached a screenshot of what my property node looks like.

 

Matthew H.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 3
(2,751 Views)