zoukankan      html  css  js  c++  java
  • treeView

            /// <summary>
            /// 绑定父节点数据
            /// </summary>
            private void BindData()
            {
                //获取到父节点信息
                var parentNodes = ComRole.ComBill.GetDepartMentDendrogram(1, this.ComUserId);
                if (parentNodes.Any())
                {

                    foreach (var pNodes in parentNodes)
                    {
                        pNodes.ComUserInfo = new ComUserInfo();
                        TreeNode node = new TreeNode();
                        node.Text = pNodes.departmentName;
                        node.Value = pNodes.identify.ToString();
                        treeDepart.Nodes.Add(node);
                        BindChildData(node, Convert.ToInt64(pNodes.identify));
                    }
                }
                iframes.Attributes.Add("src", "ComDeptContentPage.aspx?id=170");
            }



            /// <summary>
            /// 绑定子节点
            /// </summary>
            /// <param name="parentId"></param>
            private void BindChildData(TreeNode nd, long parentId)
            {
                //获取子节点信息
                var childNodes = ComRole.ComBill.GetDepartMentDendrogram(parentId, this.ComUserId);
                if (childNodes.Any())
                {
                    foreach (var childNode in childNodes)
                    {
                        TreeNode tn = new TreeNode();
                        tn.Text = childNode.departmentName;
                        tn.Value = childNode.identify.ToString();
                        nd.ChildNodes.Add(tn);
                        BindChildData(tn, Convert.ToInt64(childNode.identify));
                    }
                }
            }

  • 相关阅读:
    前端如何进阶架构师
    NPOI使用记录
    ArcGis 中空间数据的插入与更新
    (转载).net 缓存处理
    ASP.NET(c#)实现重定向的三种方法的总结
    数据库关联表之间的更新语句
    C#net多线程多文件压缩下载
    关于写文件流的情况
    C# Class获取项目的绝对路径
    C# .net中DatailsView的JS简易版
  • 原文地址:https://www.cnblogs.com/Mancy/p/2504391.html
Copyright © 2011-2022 走看看