Dev Treelist使用经验(3)

Dev Treelist使用经验(3)

循环遍历当前treelist选中节点是否有父亲节点的函数

 

/// <summary>
        /// 循环遍历节点
        /// </summary>
        /// <param name="parentNode"></param>
        /// <param name="list"></param>
        private void GetParentNodes(TreeListNode parentNode, List<TreeListNode> list)
        {
            if (parentNode.ParentNode != null)
            {
                TreeListNode node = parentNode.ParentNode;
                list.Add(node);
                GetParentNodes(node, list);
            }
        }

你可能感兴趣的:(使用经验,dev,Treelist)