2
  1. How to generate a tree view in asp.net?
  2. In my asp.net project i need a tree view like structure, the format given below alt text http://dev1.ispg.in/dg/untitled.bmp
2
  • 400kb picture is not the best idea.. Commented Aug 4, 2010 at 10:47
  • 2
    please expand Govt Girls Home Node :) Commented Aug 4, 2010 at 11:24

2 Answers 2

3

ASP.NET does have a TreeView control that you can use to display a Treeview very similar to the one you show.

If you require the Checkboxes on each and every Treeview node, but sure to set the ShowCheckBoxes attribute to the appropriate setting (i.e. ShowCheckBoxes="All">

Regarding the nodes themselves, you can bind the TreeView to a DataSource which can either be an ASP.NET SiteMap file or an XML Document. Alternatively, you can programmatically add the nodes yourself in code like so:

TreeNode tn = new TreeNode();
tn.Value = "Cities";
TreeView1.Nodes.Add(tn);
tn.ChildNodes.Add(new TreeNode("Cochin 1"));
[etc. etc.]  

Some other useful links are:

Using the TreeView Control and a DataList to Create an Online Image Gallery
ASP.NET Treeview Quickstart Tutorial

Sign up to request clarification or add additional context in comments.

Comments

2

use the asp.net treeview , have a look here everything is explained

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.