Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange problem with Treeview SelectedItem property
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00812987
Message ID:
00815302
Vues:
19
Hi Terry,

>>But when you access properties and methods of the .SelectedItem you are just accessing the node to which it refers and can manipulate it in exactly the same way as any Tree node.

>SelectedItem is a reference to a node. The properties we 'think" we are manipulating really belong to the node it references, and not 'SelectedItem'.

Aren't we both saying the same thing ?

>When we SelectedItem=.NULL. we are changing the data type of a node from object to .NULL. Refreshing the tree with a mouseclick or Acitivate, returns the node to the Object state.

.NULL. is a value not a datatype. After '.SelectedItem=NULL' .SelectedItem is still an object reference - it just doesn't point anywhere.

>This can be demonstrated in code
>cNodeKey=.SelectedItem.Key
>.SelectedItem=.NULL.
>?oNode(cNodeKey).Text && Data type error

Sorry, what is oNode ? There is no problem with :
.SelectedItem = .Nodes(1)
cnodekey = .SelectedItem.key
.SelectedItem = .NULL.
? .Nodes(cnodekey).Text
Also .SelectedItem can certainly have a .NULL. value when the tree is first populated. I don't know exactly when this gets assigned but it could be as late as Tree.GotFocus()

Regards,
Viv
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform