How to populate Treeview Control in Asp.Net using C# . Add Treeview Control from the toolbox .
Id : TreeView1
Sample application for Treeview Control
protected void Button1_Click(object sender, EventArgs e)
{
TreeNode tNode = new TreeNode();
tNode.Text = "Sreejith";
TreeView1.Nodes.Add(tNode);
TreeView1.Nodes[0].Checked = true;
for (int i = 0; i < 5; i++)
{
TreeNode tNode1 = new TreeNode();
tNode1.Text = i.ToString();
TreeView1.Nodes[0].ChildNodes.Add(tNode1);
if (i % 2 == 0)
{
TreeView1.Nodes[0].ChildNodes[i].Checked = true;
}
for (int j = 0; j < 2; j++)
{
TreeNode tNode2 = new TreeNode();
tNode2.Text = j.ToString();
TreeView1.Nodes[0].ChildNodes[i].ChildNodes.Add(tNode2);
}
}
}
tage:- How to populate Treeview Control in Asp.Net using C# . Add Treeview Control from the toolbox
Articles
- Articles(C#.NET) (3)
- ASP.NET (6)
- Asp.Net(Email) (1)
- Asp.net(Image) (2)
- Asp.Net(Web.Config) (2)
- C#.NET (5)
- C#.NET Threading (3)
- C#.NET(ASP.NET) (4)
- Comments in PHP (1)
- Encryption In PHP (1)
- iPhone (Articles) (1)
- JavaScript (1)
- Json with PHP (1)
- LINQ (1)
- PHP (2)
- PHP Constant (1)
- PHP Operators (1)
- PHP Print Command (1)
- PHP Tutorial (2)
- Strings In PHP (1)
- Variable Declaration In PHP (1)
- WPF (1)
- XAML (2)
About Me
Help Link
Followers
Posted by
Sreejith A.K
Tuesday, October 13, 2009
comments (0)
Subscribe to:
Posts (Atom)