Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange problem with Treeview SelectedItem property
Message
 
To
24/07/2003 20:35:45
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00812987
Message ID:
00813370
Views:
6
The SelectedItem can have a Selected of either true or false. I have very little experince using index to address the node - total reliance on key.

Do the indexes stay with the node? It seems the index of a node might go up or down depending on insertions or removes above it. The sequential order of the nodes. Some guidance docs suggest using "key" because "index" is so dynamic.

Do you have a reference to the first node's key? Could you try:
oTV.Nodes(lcFirstNodeKey).Selected=.t.

Are your references correct? Are "thisform" and "tree" [actualy] referencing the objects they're expected to reference?

What does FillList() do?

>While I see what you're getting at Terry, I don't think I can use Selected=.T. in this case because after it is SORTed node index #1 could be anywhere. I need to highlight the FIRST SHOWN item (which the Treview seems to do nicely, all by itself) and then use its .Key to fill the Listview with the corresponding information.
>
>By the way, FYI, it was also a reply here (by Cathy Pountney, I think) that sent me in the direction of SelectedItem to handily solve this problem. In fact I've gotta believe that it is just this problem that caused the designers to make that property.
>
>In addition, if you look at the commented line in the last code sample I show, it refers to
>...Node(1).Key and that does NOT fail, so I don't think it is the Node(1) that is the problem.
>
>What I REALLY need is to get an idea as to what it might be about some OTHER form's prior execution that might be messing up the .SelectedItem usage (as I said, it works just fine until another form is run, then .SelectedItem fails every time).
>
>Thanks for the input. Any further ideas gratefully considered.
Imagination is more important than knowledge
Previous
Reply
Map
View

Click here to load this message in the networking platform