/// <summary>
        /// 选中treeview的某个节点,需要每个node的value不同
        /// </summary>
        /// <param name="sNodeValue"></param>
        private void selectNode(TreeNodeCollection tns, string sNodeValue)
        {
            foreach (TreeNode tRoot in tns)
            {
                if (tRoot.Value == sNodeValue)
                {
                    tRoot.Checked=true;
                    return;
                }
                if (tRoot.ChildNodes != null)
                {
                    selectNode(tRoot.ChildNodes, sNodeValue);
                }
            }
        }
posted on 2012-05-30 14:11  万德源  阅读(265)  评论(0编辑  收藏  举报