zoukankan
html css js c++ java
杂杞
protected
internal
void
loadtree(ComponentArt.Web.UI.TreeView tv )
{
tv.Nodes.Clear();
DataSet ds
=
Sqlhelp.fillDataSet(
"
select * from dept where Father_dept_ID=''
"
);
foreach
(DataRow row
in
ds.Tables[
0
].Rows)
{
TreeViewNode root
=
new
TreeViewNode();
root.CssClass
=
"
tree
"
;
root.ImageUrl
=
@"
..\..\image\treeimages\res.gif
"
;
root.Text
=
row[
"
Dept_name
"
].ToString();
root.ID
=
row[
"
Sub_dept_ID
"
].ToString();
loadtree(root,row[
"
Sub_dept_ID
"
].ToString());
tv.Nodes.Add(root);
}
tv.ExpandAll();
}
private
void
loadtree(TreeViewNode node,
string
deptid)
{
DataSet ds
=
Sqlhelp.fillDataSet(
"
select * from dept where Father_dept_ID='
"
+
deptid
+
"
'
"
);
foreach
(DataRow row
in
ds.Tables[
0
].Rows)
{
TreeViewNode subnode
=
new
TreeViewNode();
subnode.Text
=
row[
"
Dept_name
"
].ToString();
subnode.ID
=
row[
"
Sub_dept_ID
"
].ToString();
node.Nodes.Add(subnode);
subnode.ImageUrl
=
@"
..\..\image\treeimages\res.gif
"
;
subnode.CssClass
=
"
tree
"
;
loadtree(subnode,row[
"
Sub_dept_ID
"
].ToString());
}
}
查看全文
相关阅读:
两种称谓
HDU 1074
趣
Educational Codeforces Round 44
nowcoder—Beauty of Trees
nowcoder-练习赛16
c++作业-8
差的东西
nowcoder-挑战赛14
BZOJ2548 [CTSC2002] 灭鼠行动
原文地址:https://www.cnblogs.com/aipeli/p/295860.html
最新文章
获取Unity3D虚拟摄像机的图像
【Augmented Reality】增强现实中的光学透射式头盔显示器的标定初步
[SDOi2012]Longge的问题 BZOJ2705 数学
Fast Matrix Operations UVA
BZOJ3156 防御准备 斜率优化dp
CodeCraft-19 and Codeforces Round #537 (Div. 2) C. Creative Snap 分治
[HAOI2007]理想的正方形 BZOJ1047 二维RMQ
[APIO2009]抢掠计划 tarjan缩点+spfa BZOJ1179
Anya and Cubes 搜索+map映射
[NOI2010]能量采集 BZOJ2005 数学(反演)&&欧拉函数,分块除法
热门文章
Codeforces Round #175 (Div. 2) A~D 题解
[SCOI2009]windy数 BZOJ1026 数位dp
HDU 3351
HDU 4576
HDU 4407
容斥原理应用
HDU 1695
HDU 4135
HDU 3791
HDU 2291
Copyright © 2011-2022 走看看