Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Expand treeview
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00647884
Message ID:
00647925
Views:
17
>>>>>>>Hi Nick.
>>>>>>>
>>>>>>>>I have the following code, my only problem is how do I identify the nodekey?
>>>>>>>>
>>>>>>>>*cmdbuttonexpand
>>>>>>>>.OleTreeView.nodes(.llnode).expanded = .t.
>>>>>>>
>>>>>>>Since your NodeClick code set llNode to the parameter passed to that method, which is an object reference to the node itself, you should change this code to:
>>>>>
>>>>>for each loNode in Thisform.OleTreeView.nodes
>>>>>  Thisform.llNode.Expanded = .T.
>>>>>endfor
>>>>>
>>>>>
>>>>>Doug
>>>>>>
>>>>>>Thanks for replying back Doug, your code worked except I need it to expand all the child nodes from the selected nodes. Is this even possible?
>>>>>>
>>>>>>Thanks again
>>>>>>Nick Patel
>>>>Thanks for replying, I tried to code, it the selected node only again, but not the rest. I did notice that my tree was flickering as if it was try to expand, but only one node expanded.
>>>
>>>Maybe the expanded property is set back to .f. somewhere else in your code after the expansion?
>>>
>>>>
>>>>Thanks
>>>>Nick Patel
>>
>>I have a .f. on expanded property in a seperate button. The code to expand is also in seperate button. When I ran the code thtough debugger, as expected, the expand button doesn't touch code for expand .f.
>
>
>I have only one button that does both, expand or collapse. As soon as you set the node's expand property to .t. or .f. it should expand or collapse.
>You could set breakpoints on
>_screen.activeform.oletree.nodes[1].expanded = .f.
>_screen.activeform.oletree.nodes[2].expanded = .f.
>(copy these in the watch window in the Debugger, and double click on the left grey band, or use the Breakpoints under Tools in the Debugger)
>You should be able to find out when nodes are re-set to collapsed after your button code expands all nodes.
>
>>
>>Thanks
>>Nick Patel
I put the
_screen.activeform.oletree.nodes[1].expanded = .f.
in the watch window, but where do I set the breakpoint? I tried setting the break point at
.llNode.Expanded = .t.
and it seemed to show true. Even the watch window for
_screen.activeform.oletree.nodes[1].expanded = .f.
returned a true. Am I on the right track?. Here is what my other button for collapse looks like:
*button colapse
WITH thisform
LOCAL g
FOR g = 1 TO .OleTreeView.nodes.count
	.OleTreeView.nodes(g).expanded = .f.
ENDFOR 
ENDWITH
Thanks
Nick Patel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform