Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
0
Reply
Trouble Building Multilevel TreeView Object Hierarchy
Robert Hurd
Apr 26 2012 12:50 PM
2.1k
Reply
Hi there,
Firstly thank you for taking the time out to read this post.
I'm having difficulty creating a WPF TreeView Hierarchy object. The object may have many child nodes, which in turn may also have many child nodes. The number of node levels need to be unlimited. Some nodes may have more levels than others.
I've tried creating an example but currently I can only construct a Hierarchy 2 levels deep.
I have attached my source code for the project. All it contains is the treeview control and c# objects, methods and classes for this particular problem.
When you open the source code, open file MainWindow.cs and find the Window_Loaded() method. Within the method you'll notice I'm trying to create a list of items with ID, ParentID & Name. The problem I have is that the items with ID=6 & ID=7 aren't being created when I convert the flat list into an hierarchal object, thus not visible in the treeview control when the ItemSource is set.
Thank you very much for your time. All help is appreciated.
Attachment:
wpfapplication1-2.zip
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
Routed event in WPF?
How to get the checked items of checkboxes created dynamically and write that value to a file in WPF?