Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Search for Values in Treeview
Message
From
24/04/2002 12:25:55
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00648702
Message ID:
00648757
Views:
23
Nick,

You can modify the text comparison statement to anything you like.
*&  some examples with node.Text is "Patel, Nick" and pcSearch is "Patel".
*&
*&  1.  IF UPPER(ALLTRIM(.Text)) = UPPER(ALLTRIM(pcSearch))
*&      returns .T.
*&  2.  IF UPPER(ALLTRIM(.Text)) == UPPER(ALLTRIM(pcSearch))
*&      returns .F.
*&  3.  IF UPPER(ALLTRIM(pcSearch)) $ UPPER(ALLTRIM(.Text))
*&      returns .T.
HTH.

Wan


>>Nick,
>>
>>You can check for the Text property of each node object.
>>
>>*&  Form.SearchTree() method.
>>LPARAMETERS pcSearch
>>*&
>>LOCAL loNode
>>*&
>>FOR EACH loNode IN Thisform.oleTreeView.Nodes
>>     WITH loNode
>>          IF .Text = pcSearch
>>               .Selected = .T.
>>               .Expanded = .T.
>>               .EnsureVisible()
>>               EXIT
>>          ENDIF
>>     ENDWITH
>>NEXT loNode
>>
>>
>>Or the user can type in the treeview, and it works just like the windows explorer.
>>
>>HTH.
>>
>>
>>Wan
>>
>>>My user enters a search value, how can I look for that value in a treeview that I have populated and then expand that particular node in the treeview highlighting the found value?
>>>
>>>Thanks
>>>Nick Patel
>What if my pcsearch was partial text, meaning I have nodes that have names such as:
>
>Patel, Nick
>Leedy, Susan M.
>Broth, Elma
>
>and my pcsearch had value of lets say "Patel", can I search partial input values?
>
>Thanks
>Nick Patel
Previous
Reply
Map
View

Click here to load this message in the networking platform