Click here to Skip to main content
15,901,284 members
Please Sign up or sign in to vote.
3.67/5 (2 votes)
See more:
Can someone please tell me how to create a binary treeview in c#. I want to build a tree like in this link for my project. The link is[^]

On the left hand site there is a binary tree structure for which I have to write code for in C#.

So please tell me how to create a binary tree for that.

Thanks in advance!

Added the link from the repost of this question!
Updated 21-May-12 1:20am
Manfred Rudolf Bihy 21-May-12 6:48am    
The link you provided does not work. Please fix it!
Manfred Rudolf Bihy 21-May-12 7:15am    
When I told you to fix your link, I didn't say anything about reposting you question. Don't do that again!
Manfred Rudolf Bihy 21-May-12 7:18am    
The tree that is depicted by the website you linked to is not a binary tree. You better learn to ask the right questions otherwise you won't receive any correct answers!

Since you didn't frame your question well you did not receive any useful information. First you failed by posting a non functional link and the you failed by thinking you could just post another question. From the link in your repost you could have easily seen that what you are looking for is a treeview. That word is in the URL.

Anyhow here is the MSDN information for the ASP.NET TreeView control[^].

Here is a tutorial:[^].

See here on CP: A simple Binary Search Tree written in C#[^].

or here:[^]

and not to forget here:[^].

Let's see what the Microsofties have:[^].

That should just about do it. Any doubts left?


Share this answer
Share this answer
Manfred Rudolf Bihy 21-May-12 7:26am    
OP was after a treeview and not a binary tree. I corrected my solution. Feel free to follow. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900