User6667769
User6667769

Reputation: 805

TreeList - how to get last child node of the current selected parent node?

I have created TreeList in Windows form and I added up and down buttons .In treelist there are lot of parent nodes with child nodes. Once expand a parent node , having child nodes and the child node is also a parent node. I want to get the count value of child node for current selected Parent Node.

Please Guide me solve this issue.

Thanks and regards

Saravanan

Upvotes: 1

Views: 1577

Answers (2)

User6667769
User6667769

Reputation: 805

In my task ,I searched a lot of process.But there is no need to find out the count of child or parents nodes ..there is a predefined function in c#.which is used to move all over the in the treelist nodes.

TreeList.MoveNextVisible();

Treelist.MovePrevVisible();

or

TreeList.MoveNext();

TreeList.MoveNextVisible();

or

TreeList.Move();

TreeList.Move();

Once expand nodes in treelist,these prededined fuction will move in to their parents and its child nodes

Upvotes: 1

Phylyp
Phylyp

Reputation: 1689

The SelectedNode property of a TreeView object returns the currently selected node.

For any node in a tree view (including the one returned by SelectedNode), the LastNode property returns the last child node under it.

In general, it would be beneficial for you to study all the properties and methods of a class that you're working on, to discover is behaviours. For instance in this case, looking at the TreeView class and TreeNode class gives you the information required to navigate a tree view.

Upvotes: 1

Related Questions