DevExpress TreeList 全选和反选 z

/// <summary>
       /// 全选树
       /// </summary>
       /// <param name="tree">树控件</param>
       /// <param name="nodes">节点集合</param>
      public virtual void SelectTreeListAll(DevExpress.XtraTreeList.TreeList tree,TreeListNodes nodes=null)
       {
           nodes = nodes ?? tree.Nodes;
           foreach(TreeListNode item in nodes)
           {
               tree.Selection.Add(item);
               if (tree.HasChildren)
               {
                   SelectTreeListAll(tree, item.Nodes);
               }
           }        }

 

posted on 2017-01-04 19:39  武胜-阿伟  阅读(724)  评论(0编辑  收藏  举报