상세 컨텐츠

본문 제목

TreeNode 찾기

C#

by 탑~! 2011. 12. 14. 17:05

본문

private void FindNodeInHierarchy(Infragistics.Win.UltraWinTree.TreeNodesCollection nodes, string strSearchValue)
        {
            for (int iCount = 0; iCount < nodes.Count; iCount++)
            {
                //System.Diagnostics.Debug.Print(nodes[iCount].Text.ToUpper());
                UltraTreeNode childNode = this.GetNodeByKey(nodes[iCount].Key);

                if (nodes[iCount].Text.ToUpper().Contains(strSearchValue.ToUpper()))
                {
                    childNode.Parent.Expanded = true;
                    childNode.Selected = true;
                    this.ExpandParentNodeInHierarchy(childNode);
                    m_bNodeFound = true;
                    this.FormInterface.CloseProgressBar();
                    return;
                }
                else
                {
                    childNode.CollapseAll();
                    m_bNodeFound = false;
                }
                //nodes[iCount].Expanded = true;
                FindNodeInHierarchy(nodes[iCount].Nodes, strSearchValue);
                if (m_bNodeFound)
                {
                    this.FormInterface.CloseProgressBar();
                    return;
                }
            }
        }

관련글 더보기