>>>Hi All,
>>>
>>>Is it possible to Programatically Expand a node if I know the Node's KEY?
>>>
>>>This does nothing: THISFORM.MenuTree.expand(nNodeKey)
>>>
>>>TIA
>>>Mike
>>
>>Expand is an event that occurs when a node is expanded. It is not a method to Expand a specified node.
>>
>>Try:
>>THISFORM.MenuTree.Nodes(nNodeKey).expanded = .T.
>>
>>HTH.
>
>Larry,
>I also use expanded. However it can be used to expand too. It expects node object as parameter :
>
with THISFORM.MenuTree
> .Expand(.Nodes(nNodekey))
>endwith
>
Are you sure about this? Any code in the Expand event may fire using the correct node; however, the node itself will not be expanded.
>OTOH Expanded = .t. approach might need also :
>
>
with THISFORM.MenuTree
> .Nodes(nNodeKey).expanded = .T.
> .Nodes(nNodeKey).EnsureVisible
>endwith
Cetin
I would simply put the EnsureVisible code in the Expand event of the TreeView. At that time, you already have the reference to the Node in question.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao