insert node in treelist at specific position
insert node in treelist at specific position
(OP)
Dear all
I am trying to insert a node into a TreeListMenu. It can successfully add nodes into a tree, at different level - using parent and child relationship. The function I am using is:
However, the order of the nodes within the same level goes as the default order, no matter how I insert them. For example, if I would like to list a tree as (L0=level 0, L1=level 1):
_L0: a
___L1: b
___L1: c
_L0: d
where 'a' and 'b' are parent nodes, but 'b' and 'c' are child nodes of node 'a'. The problem is, no matter I insert 'b' first or 'c' first, it will always be displayed as 'c' listed after 'b'. This seems to follow apathetic order. (if I change the name of 'b' to be 'm' for example, the list will automatically updated as 'm' after 'c' in Level 1(L1).
Could anyone suggest a method that I may list the tree nodes in the way the user wanted but rather than default? I tried to change the option 'NodeInsertOptionAlwaysFirst' as other options, it doesn't help.
Many thanks
Gan
I am trying to insert a node into a TreeListMenu. It can successfully add nodes into a tree, at different level - using parent and child relationship. The function I am using is:
this->tree_control0->InsertNode(CurrentNOde, ParentNode, NULL, Tree::NodeInsertOptionAlwaysFirst);
However, the order of the nodes within the same level goes as the default order, no matter how I insert them. For example, if I would like to list a tree as (L0=level 0, L1=level 1):
_L0: a
___L1: b
___L1: c
_L0: d
where 'a' and 'b' are parent nodes, but 'b' and 'c' are child nodes of node 'a'. The problem is, no matter I insert 'b' first or 'c' first, it will always be displayed as 'c' listed after 'b'. This seems to follow apathetic order. (if I change the name of 'b' to be 'm' for example, the list will automatically updated as 'm' after 'c' in Level 1(L1).
Could anyone suggest a method that I may list the tree nodes in the way the user wanted but rather than default? I tried to change the option 'NodeInsertOptionAlwaysFirst' as other options, it doesn't help.
Many thanks
Gan





RE: insert node in treelist at specific position
Suresh
www.technisites.com.au
RE: insert node in treelist at specific position
Thanks for the reply. Yes, this solved the problem.
Many thanks!
Gan