PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → Getting the Selected Value from a TreeView Control
Getting the Selected Value from a TreeView Control
Débuté par Carlos Antunez, 23 sep. 2017 16:21 - 1 réponse
Posté le 23 septembre 2017 - 16:21
Hi and thanks for the Help in advance.

I am having an issue with the TreeView Control (Not the TreeView Table).

I am able to to load the data into the TreeView Control from my database table without any issues. I get my Root, my Nodes and my leafs.

What I need to do is simple, however, I can't get it to work,and no one sims to know, or at least no one have been able to help me.

All I need is that when I click on my leaf, an info message that says "You Click on Customer Name: <The Value of the Customer Name> for example if I click on Mr. Donal Greg, and so on.

This is the code I have but it does not work

Info("You Have Clicked On "+TreeIdentifier(TREE_Customers, TreeSelect(TREE_Customers,True)))

Can you help?

Thanks

Best regards
Membre enregistré
37 messages
Posté le 30 septembre 2017 - 13:20
Ok. After a long wait and a hard research on my own. I was able to get a help from a friend in Facebook (Moises Velez)

Here is the Code to accomplish what is so simple to do but the PCSoft Help lacks

I hope this will help others

Res is string
Res = TreeTypeItem(TREE_Areas, TreeSelect(TREE_Areas))
SWITCH Res
CASE tvError: Info("Element not found")

CASE tvLeaf:
Info("The element is a Leaf: " + CR + "The Value:"+ExtractString(TreeSelect(TREE_Areas),1,TAB,FromEnd))
Info("The Path is: " + TreeSelect(TREE_Areas))
Info("The Index is:" + TreeIdentifier(TREE_Areas,TreeSelect(TREE_Areas)))
CASE tvNode: Info("The element is a Node")
//The Node does Not Count, it does not have a decendant over it's nodes and leafs, when selected the root it will return 0 or Null
Info("The Index is: " + TreeIdentifier(TREE_Areas,TreeSelect(TREE_Areas)))
END


--
Best regards,

Carlos