07-24-2012 12:53 PM
Hello All.
I am encountering problem in inserting tree items in a parent child recurring manner. My requirement is that everytime i presses the button, one parent should be inserted in the tree along with its child. Its output should be just like
Fault Code: 7400
Fault Code: 7400
Fault Code: 7401
Fault Code: 7401
and so on.
I am not getting the desired output. What should be way of doing this. Please find the attached project too.
Regards.
Solved! Go to Solution.
07-24-2012 04:38 PM - edited 07-24-2012 04:38 PM
I have no CVI on this machine to run your project, but in a fast look at the code I noticed that you are always using 0 as the item index. You mustr save the index of the parent item and use it for the childs instead:
idx = InsertTreeItem (panelHandle, PANEL_TREE, VAL_SIBLING, 0, VAL_LAST,temp_buffer, "",0, -1);
InsertTreeItem (panelHandle, PANEL_TREE, VAL_CHILD, idx, VAL_LAST,temp_buffer, "",0, -1);
but I don't understand what the child means: the code above will produce the following output ( + here mimics the tree symbols):
Fault code: 7400
+ Fault code: 7400
Fault code: 7401
+ Fault code: 7401
07-26-2012 07:03 AM
Thanks..I got the after you have pointed the mistake in relative index.I have just corrected the relative index and got the desired output 🙂