Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DBI Tech ctTree Control Problem
Message
General information
Forum:
Visual FoxPro
Category:
ActiveVFP
Miscellaneous
Thread ID:
01287375
Message ID:
01287500
Views:
7
I'm using Component Toolbox 6.0.

I have added a series of nodes to the tree. I then want to go back and add additional nodes as children of
pre-existing nodes.

The ctTree nodes don't seem to have key values, only Indexes. The problem is that the index values change each time
a new node is added. Therefore there's no way to know for sure what node is the parent. Here's an example:

I first create an 'outline' of sorts, going top to bottom:
Root (Index 0)
  Parent 1 (Index 1)
    Child a (Index 2)
    Child b (Index 3)
    Child c (Index 4)
  Parent 2 (Index 5)
    Child d (Index 6)
    Child e (Index 7)
    Child f (Index 8)
Note that at this point the index numbers are sequential. Since there are no key values I have stored the index
values in an array on the form. I then can look up the node using its caption and return the index number.

Next I want to insert a node after 'Child b' under 'Parent 1'. Polling my array, I determined that the index value
for the parent node is 3 ('Child b), and I using that index value I insert the node there. Here's the result:
Root (Index 0)
  Parent 1 (Index 1)
    Child a (Index 2)
    Child b (Index 3)
      Grandchild b1 (Index 4)
    Child c (Index 5)
  Parent 2 (Index 6)
    Child d (Index 7)
    Child e (Index 8)
    Child f (Index 9)
Notice that all the index values from Grandchild b1 down have been incremented. The index values stored in the
array are now no longer valid.

Since the only value the control offers for reference is the index value, no keys, then there seems to be no
reliable means to identify a node.

Now of course I could be completely missing something, but from what I can see, this seems to be the default
behavior for the ctTree control





>I've used some of DBI's controls. Can you describe your problem?
>
>
>>Anyone have experience using this control? I'm stuck and need some help.
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform