Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert node in treelist at specific position

Status
Not open for further replies.

lugan2

Mechanical
Apr 10, 2013
42
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:
[pre]this->tree_control0->InsertNode(CurrentNOde, ParentNode, NULL, Tree::NodeInsertOptionAlwaysFirst);[/pre]

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
 
Replies continue below

Recommended for you

Hi Ufsure

Thanks for the reply. Yes, this solved the problem.

Many thanks!
Gan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor