/// <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); } } }