0% found this document useful (0 votes)
4 views

3.c Treeview

The document outlines the use of a TreeView control to perform operations such as displaying checked nodes in a DataList and handling node selection events. It includes a code example in C# demonstrating how to bind checked nodes to a DataList and respond to node selection. The main functionalities are implemented in the Page_Load and event handler methods for button clicks and node selection changes.

Uploaded by

fannyskylark2003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

3.c Treeview

The document outlines the use of a TreeView control to perform operations such as displaying checked nodes in a DataList and handling node selection events. It includes a code example in C# demonstrating how to bind checked nodes to a DataList and respond to node selection. The main functionalities are implemented in the Page_Load and event handler methods for button clicks and node selection changes.

Uploaded by

fannyskylark2003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Aim: Demonstrate the use of TreeView control perform following

operations.

(a)Treeview control and datalist.

(b)Treeview Operations

Design:
Coding:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page


{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
TreeNodeCollection T;
T = TreeView1.CheckedNodes;
DataList1.DataSource = T;
DataList1.DataBind();
DataList1.Visible = true;
}
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
Response.Write("<b>You have selected the option:</b>"+TreeView1.SelectedValue);
}
}
Output:

You might also like