打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
DropDownList中绑定树形结构
数据库表图

要显示的结果图

 

private
void InitDepartDropDown()
        {

            CustomerControlInfo info;
           
this.Items.Clear();
           
this.Items.Add(new ListItem("请选择成员", "0"));
           
int OwnerUserId = GetOwnerUserID();
            ArrayList al
= CustomerControlController.GetUCPBerInfoDeptName(OwnerUserId);
           
if (al.Count > 0)
            {
               
for (int i = 0; i < al.Count; i++)
                {
                     info
= (CustomerControlInfo)al[i];
                   
int UserId = info.UserId;
                   
int ParentDept = info.ParentDept;
                   
string DeptName = info.DeptName;
                   
if (ParentDept>0)
                        {
                            DeptName
= "**|-" + DeptName;
                        }
                       
else
                        {
                            DeptName
= "|--" + DeptName;
                        }
                   
this.Items.Add(new ListItem(DeptName, UserId.ToString()));

                }
            }

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
AJAX在线音乐网站(4)Part two 功能实现
asp.net局部刷新技术
Asp.net关于DropDownList项,选中指定项的方法
Asp.Net Table控件动态生成表格操作实例(代码调试通过)
ASP.NET无刷新二级联动下拉列表,同样适与firefox
[jQuery]使用jQuery.Validate进行客户端验证(高级篇
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服