cancelar
Mostrando los resultados de 
Buscar en lugar de 
Quiere decir: 

how to programmatically select items in a tree

¡Resuelto!
Ir a solución

Hi,

 

I am looking to persist the tree selection in my application (save to a file on close, load from the file on open), but I cannot figure out how to programmatically select an item in a tree on load.  I would like to select the item as well as have it highlighted as is the usual behaviour if selecting via mouse.

 

I have tried writing to the "ActiveItemTag" property, but this does not work.  Any ideas?

0 kudos
Mensaje 1 de 4
7.568 Vistas
Solución
Aceptado por el autor del tema AK01

AK01,

 

Try the "Value" property.  The value of a tree control is the tag that is currently selected, so setting the Value to the appropriate tree tag will highlight that item.

 

Chris M 

Mensaje 2 de 4
7.561 Vistas

Hai,

 

"Value" Property hightlights the tree item given as input.  It is a string data type and hence wire the element tag to highlight that element.  If the "selection mode" is set to "1 or more items" then wire a 1d string array to high light multiple items.

 

Hope it helps.

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
Mensaje 3 de 4
7.537 Vistas
Thanks, guys, that works perfectly 🙂
0 kudos
Mensaje 4 de 4
7.502 Vistas