Getting all checked checkboxes from Treeview in asp.net using c#

if i have a Treeview like this image
and if i want to track all the lable names of check boxes which are checked into textbox like this

then i have to write my code like this

ArrayList al = new ArrayList();

foreach (TreeNode node in TV1.CheckedNodes)
{

Response.Write(node.Text);
al.Add(node.Text);

}

for (int i = 0; i < al.Count; i++)
{
TextBox1.Text += al[i].ToString() + " ";
}

the concept here is iam checking for all checked checkboxes and placing its names into arraylist and then placing this into TextBox

"This worked for me wheni was using static data in treeview List

Advertisements

About kakani santosh kumar

Working as Software Engineer in Prithvi Information Solutions having 3 years of Experience in Dotnet Framework ranging from 1.1 to 3.5
This entry was posted in Articles, Database, Programming and tagged , , . Bookmark the permalink.

2 Responses to Getting all checked checkboxes from Treeview in asp.net using c#

  1. Rouan says:

    Thanks, as simple as that. Was looking for a quick way to traverse my Treeview in ASP.NET

  2. Altaf Patel says:

    thanks. it saved my time.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s