LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Tree control in LabWindows

Hi,
I am using tree control ( LW ver 7.1 ) and fill it programitically, reading a file. After inserting a few child items I need to add another item as parent.  I could n't find any method in the library to insert an item at a higher (parent) level.  The options available are either 'Sibiling' or 'child'.  In otherwords, is there a way to change an existing item one level high. Could anybody help me?
 
regards,
Sajy    
0 Kudos
Message 1 of 3
(3,056 Views)

Hello Sajy,

The key is to correctly set the relative index and relation parameters.  In order to insert another parent item, you're basically creating a sibling of an already existing parent or of your root index (0).  So you should get the index for one of the parent nodes in the tree, then pass that index or 0 in the relative index parameter, then set the relation parameter to "Sibling".

To change the position of an element in the tree you can use the MoveTreeItem function with the same rules about the relative index and relation parameters.

Thanks.

Message Edited by Wendy L on 07-06-2005 02:39 PM

Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 2 of 3
(3,054 Views)

Hello Wendy,

Thank you very much. I have tried the moveTreeItem method and solved the problem.

Sajy
0 Kudos
Message 3 of 3
(3,021 Views)