Thanks. Agreed but what happens to the intermediate nodes.
For eg. the tree in the current state on a given branch is expanded to 2 levels (third level is populated with Dummy nodes) and now the navigation leads the user to a node 6 levels deep in the same branch line of the tree. I use the below command and get to populate the tree for as per the eg. of level 6 (child) of lcParentKey (parent level 5 undefined as the expansion is only upto level 2 in the same branch line)
>Doesn't matter you provide parentkey and use 4 (child) as releavance parameter.
>(TV.Nodes.Add(lcParentKey,4,lcNewKey,lcText))
>Cetin
>
>>Thanks Cetin
>>
>>Now one more query. Generally the populating happens to 2 levels, Root, Child of Root. Now what if the navigated to record is say 5 levels deep?
>>
>>>I think I got you wrong. Assuming you have a schema to create a unique key per record navigated and you know its parent key :
>>>
>>>
>>>lcKeyNew = 'SomeNewKey'
>>>lcKeyParent = 'ParentKey'
>>>lcText = 'NodeText'
>>>if type('TV.Nodes(lcKey)')#'O'
>>> if empty(lcParentKey)
>>> TV.Nodes.Add(,0,lcNewKey,lcText)
>>> else
>>> TV.Nodes.Add(lcParentKey,4,lcNewKey,lcText)
>>> endif
>>>endif
>>>TV.Selecteditem = TV.Nodes(lcNewKey)
>>>TV.Nodes(lcNewKey).Expanded = .t.
>>>TV.Nodes(lcNewKey).Ensurevisible
>>>
Cetin
>>>
>>>
>>>>Hi Cetin
>>>>
>>>>Thanks for your response but sorry I cannot really understand what will happen and EnsureVisible I am totally at lost.
>>>>
>>>>I have functions like BuildTree and SynchronizeTreeView etc. How will the three lines do the pouplating of my treeview. I have borrowed a lot of codes from 2 different places to get this one working for me using CodeBook.
>>>>
>>>>>>On a form I have a TreeView and navigationable TextBoxes. I have sparse populated the TreeView as the no. of node can go high, now if I use the TreeView for navigation then alls well.
>>>>>>
>>>>>>If I navigate using the toolbar for the form, though the TV will highlight the right records if populated (by user interaction) but for the none populated nodes the TV is confused.
>>>>>>
>>>>>>Any logic to make a sparse TV to populate on record movement rather than clicking on the pluses and minuses
>>>>>>
>>>>>>Thanks in advance
>>>>>
>>>>>TV.Selecteditem = TV.Nodes(NodeKey)
>>>>>TV.Nodes(NodeKey).Expanded = .t.
>>>>>TV.Nodes(NodeKey).Ensurevisible
>>>>>
>>>>>Cetin