LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pull parent along with child in tree control

I am wondering if it is possible to pull parent and child from a double click selection on a tree control.  I am pulling data from a database and then inserting it into a tree control by year, month, and day, as shown below.

oven1
    -2007
       -Month
          -1
             1
             2
             4
          -2
             2
             5
    -2006
       -month
          -1
             2

Now, the problem is if I left the date in 12/2/2006, 12/3/2006 etc, then I could use the 1_1, 1_2 item tag to determine which item in the list and therefore which oven and date was selected.  The problem is that if you have a full years worth of data, it will take forever to get down to december in the tree control

But with the month, day and year split up as it is now, I cant use that same method (at least I cant figure out how to).  If you dbl click on the 2007, Jan 2, the item tag is 2, and then the January 2006 is 2_2.  Which makes sense since the tree control keeps track of the same numbers and then increasses the _* accordingly.  The issue I have is that data may not be recorded each month, so if I was saying that 1 is Jan 1 and 1_1 is Feb 1, etc, but if I didnt record data on Feb 1, then 1_1 is actually say  March 1.  Plus, I do not have a way with this method to track the year.Smiley Mad

I suppose that I could go back to having the calander control and just blindly selecting dates to get data, but the user does not know if data was collected in that time period or not.  The tree control only populates dates that have data associated with them.

Any ideas??

Kenny
Kenny

0 Kudos
Message 1 of 2
(2,450 Views)
I was able to solve my problem by using the item tag to the Navigate Tree: Get Parent invoke node and then wiring through the item to the next item tag as needed.

I attached a screen shot.

Kenny
Kenny

0 Kudos
Message 2 of 2
(2,441 Views)