比如一个ID为A01的节点
如何添加它的子节点呢?解决即给分!
如何添加它的子节点呢?解决即给分!
解决方案 »
- [ASP.NET控件]收集PDF文件浏览
- 留言板代码
- 怎么读取GridView其他分页的数据??????当前不翻页的情况下??
- 一个使用.net的ajax问题
- 为什么在中文操作系统下不能载入用英文操作系统和英文Visual studio 做的水晶报表文件
- 初学ASP.net的第十三个问题( 添加 ) 我的分数很少,还是想请教大虾门.
- 请问
- The compiler failed with error code 128. 请高手指教
- 如何产生自动编号
- request以及部分函数的使用
- 100送:页面做postback时,在page_load里怎样知道当前是单击哪个按钮触发的?
- 如果使用Crystal report 10,到底能得到什麽样的效果?(没用过想试试)
{
DataSet ds=(DataSet) this.ViewState["ds"];
DataView dvTree = new DataView(ds.Tables[0]);
//过滤ParentID,得到当前的所有子节点
dvTree.RowFilter = "[PARENTID] = " + ParentID;
foreach(DataRowView Row in dvTree)
{
TreeNode Node=new TreeNode() ;
if(pNode == null)
{ //添加根节点
Node.Text = Row["ConText"].ToString();
//Node.NavigateUrl = Row["url"].ToString();
//Node.NavigateUrl += ".aspx";
Node.NavigateUrl ="datalist.aspx"; Node.ImageUrl ="images/timage/";
Node.ImageUrl += Row["url"].ToString();
Node.ImageUrl += ".gif";
TreeView1.Nodes.Add(Node);
Node.Expanded=true;
AddTree(Int32.Parse(Row["ID"].ToString()), Node); //再次递归
}
else
{ //?添加当前节点的子节点
Node.Text = Row["ConText"].ToString();
Node.NavigateUrl = "test.aspx";
Node.ImageUrl ="images/timage/";
Node.ImageUrl += Row["url"].ToString();
Node.ImageUrl += ".gif";
pNode.Nodes.Add(Node);
Node.Expanded = true;
AddTree(Int32.Parse(Row["ID"].ToString()),Node); //再次递归
}
}
}
{
//在这里找到你需要的节点nodex
nodex.Nodes.Add(Node)
}