Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Expand treeview
Message
From
23/04/2002 13:48:30
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00647884
Message ID:
00648325
Views:
13
>>
>>
*Custom form method expandall
>>  Lparameters tnIndex
>>  Local lnIndex
>>  With this.OleTreeView
>>    .Nodes(tnIndex).Expanded = .t.
>>    If .Nodes(tnIndex).Children > 0
>>      lnIndex  = .Nodes(tnIndex).Child.Index
>>      .ExpandAll(lnIndex)
>>      Do while lnIndex # .Nodes(tnIndex).Child.LastSibling.Index
>>        lnIndex = .Nodes(lnIndex).Next.Index
>>        .ExpandAll(lnIndex)
>>      Enddo
>>    Endif
>>Endwith
>>
Cetin
>
>Ok I made the expandall a custom method and I am calling it as follows from my expand.click button:
>
>
>With thisform
>  .expandall(.OleTreeView.SelectedItem.Index)
>Endwith
>
>
>However I am still getting an error
OLE Error Code 0x8002006: Unknown Name
when I get to my .expandall method on the line that says:
>
>
.ExpandAll(lnIndex)
>
>Is this because of the recursive 128 max you was talking about. If I had 4 nodes and I select node 3 then expand, I still get the error and that is only 1 node of expansion.
>
>node1===>node2===>node3====>node4
>
>Anyway, thank you for your help, your techniques are exceptional.
>Nick Patel

No Nick,
This time it's me did coding error :) I simply failed I made it 'with this.OleTreeView' and OleTreeview doesn't have ExpandAll method (when subclassed and made that a method of tv it was right :)
Prefix .ExpandAll calls with this (this.ExpandAll(..))
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform