TreeNodeCheckChange 當TreeView服務器控件的復選框在向服務器的兩次發送過程之間有所更改時發生
SelectedNodeChange 當選擇TreeView服務器控件中的節點時發生
TreeNodeExpanded 當展開TreeView服務器控件中的節點時發生
TreeNodeCollapsed 當折疊TreeView服務器控件中的節點時發生
TreeNodePoulate 當其PopulateOnDemand屬性設置為true的節點在TreeView服務器控件中展開時發生reeView
TreeNOdeDataBound 當數據項綁定到TreeView服務器控件中的節點時發生
TreeView服務器控件的節點文字有兩種模式
SelectAction屬性來指定單擊TreeView服務器控件的節點時所觸發的事件
None 當選擇節點時不觸發任何事件
select 當選擇節點時TreeView服務器控件觸發SelectNodeChange事件
Expand 當選擇節點時TreeView服務器控件觸發TreeNodeExpanded事件
selectExpand 當選擇節點時TreeView服務器控件同時觸發SelectNodeChange和TreeNodeEcpand事件
using System
public partial class Default
{
protected void Page_Load(object sender
{
if (!IsPostBack)
{
DataView DView = dv(
foreach (DataRowView drv in DView)
{
TreeNode tn = new TreeNode();
tn
tn
tn
TreeView
AddchildNode(tn);
}
}
}
private void AddchildNode(TreeNode tn)
{
string id = tn
DataView dView = dv(
foreach (DataRowView drv
{
TreeNode ctn = new TreeNode();
ctn
ctn
ctn
tn
}
}
private DataView dv(string str)
{
string mycon = ConfigurationManager
SqlConnection con = new SqlConnection(mycon);
SqlDataAdapter da = new SqlDataAdapter(str
DataSet ds = new DataSet();
da
return ds
}
protected void Button
{
if (TreeView
{
foreach (TreeNode tn in TreeView
{
if (tn
{
foreach (TreeNode ctn in tn
{
Response
}
}
else
{
Response
}
}
}
}
protected void TreeView
{
Response
}
protected void TreeView
{
Response
}
protected void TreeView
{
if (IsPostBack)
{
Response
}
}
}
From:http://tw.wingwit.com/Article/program/net/201311/11766.html