当前位置: 首页>>代码示例>>C#>>正文


C# RadTreeNode.CollapseChildNodes方法代码示例

本文整理汇总了C#中RadTreeNode.CollapseChildNodes方法的典型用法代码示例。如果您正苦于以下问题:C# RadTreeNode.CollapseChildNodes方法的具体用法?C# RadTreeNode.CollapseChildNodes怎么用?C# RadTreeNode.CollapseChildNodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RadTreeNode的用法示例。


在下文中一共展示了RadTreeNode.CollapseChildNodes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DuyetDeCheckLaiChucNang


//.........这里部分代码省略.........
        //                    DataRow dr = dtQue.NewRow();
        //                    dr.ItemArray = dtBC.Rows[i].ItemArray;
        //                    if (dtQue.Rows[0][FeildValue].ToString().Trim() != dtBC.Rows[i][FeildValue].ToString().Trim())
        //                    {
        //                        dtQue.Rows.Add(dr);
        //                    }
        //                }
        //            }
        //            dtQue.Rows[0].Delete();
        //            dtQue.AcceptChanges();
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        //Interaction.MsgBox("coLoi");
        //    }
        //}
        //private RadTreeNode SearchNode( string IDTK, RadTreeView Tree)
        //{
        //    RadTreeNode ReNode = default(RadTreeNode);
        //    for (int j = 0; j <= Tree.Nodes.Count - 1; j++)
        //    {
        //        ReNode = SearchNodeDQ(Tree.Nodes[j], IDTK);
        //        if ((ReNode != null))
        //            break; // TODO: might not be correct. Was : Exit For
        //    }
        //    return ReNode;
        //}
        //private RadTreeNode SearchNodeDQ(RadTreeNode NodeTra, string IDTK)
        //{
        //    if (NodeTra == null)
        //    {
        //        return null;
        //    }
        //    else
        //    {
        //        if (NodeTra.Value.ToString() == IDTK)
        //            return NodeTra;
        //        if (NodeTra.Nodes.Count == 0)
        //            return null;
        //        for (int i = 0; i <= NodeTra.Nodes.Count - 1; i++)
        //        {
        //            if (NodeTra.Nodes[i].Value != IDTK)
        //            {
        //                SearchNodeDQ(NodeTra.Nodes[i], IDTK);
        //            }
        //            else
        //            {
        //                return NodeTra.Nodes[i];
        //            }
        //        }
        //        return null;
        //    }
        //}
        //private DataTable LayDSTKCon(DataTable _dtTree, int IDTra, string FeildParent)
        //{
        //    DataTable dt = _dtTree.Clone();
        //    DataRow[] _Row = _dtTree.Select(FeildParent + " = " + IDTra.ToString());
        //    if (_Row.Length > 0)
        //    {
        //        for (int i = 0; i <= _Row.Length - 1; i++)
        //        {
        //            dt.ImportRow(_Row[i]);
        //        }
        //    }
        //    return dt;
        //}
        ////
        private void DuyetDeCheckLaiChucNang(RadTreeNode currentNode)
        {
            try {
            //RadTreeNode objTreeNode = default(RadTreeNode);
            RadTreeNode objTemp = default(RadTreeNode);
            bool checkAll = true;

            objTemp = currentNode.Nodes[0];
            if (objTemp == null) {
            return;
            // menu thi hanh
            } else {
            while ((objTemp != null)) {
                DuyetDeCheckLaiChucNang(objTemp);
                objTemp = objTemp.Next;
            }
            currentNode.CollapseChildNodes();
            // xet tat ca cac nut con
            foreach(RadTreeNode objTreeNode in currentNode.Nodes)
            {
                if (!objTreeNode.Checked) {
                    checkAll = false;
                    break; // TODO: might not be correct. Was : Exit For
                }
            }
            if (checkAll)
                currentNode.Checked = true;
            }
            } catch (Exception ex) {

            }
        }
开发者ID:chutinhha,项目名称:web-quan-ly-kho,代码行数:101,代码来源:Authority_Group.aspx.cs

示例2: CheckDepartmentTree

        private void CheckDepartmentTree(RadTreeNode currentNode, string[] sArrDe,ref bool OK)
        {
            try
            {
            //RadTreeNode objTreeNode = default(RadTreeNode);
            RadTreeNode objTemp = default(RadTreeNode);
            if (currentNode.Nodes.Count > 0)
            objTemp = currentNode.Nodes[0];
            else
            objTemp = null;
            if (objTemp == null)
            {
            return;
            // menu thi hanh
            }
            else
            {
            while ((objTemp != null))
            {
                CheckDepartmentTree(objTemp, sArrDe,ref OK);
                objTemp = objTemp.Next;
            }
            currentNode.CollapseChildNodes();

            foreach (RadTreeNode objTreeNode in currentNode.Nodes)
            {
                for (int k = 0; k < sArrDe.Length; k++)
                    if (sArrDe[k] == objTreeNode.Value.ToString())
                    {
                        objTreeNode.Checked = true;
                        OK = true;
                        break;
                    }
            }
            //if (OK)
            //    currentNode.Checked = true;
            }
            }
            catch (Exception ex)
            {

            }
        }
开发者ID:chutinhha,项目名称:web-quan-ly-kho,代码行数:43,代码来源:Authority_Group.aspx.cs

示例3: CheckFunctionTree

        private void CheckFunctionTree(RadTreeNode currentNode,DataTable _dt,ref bool OK)
        {
            try
            {
            //RadTreeNode objTreeNode = default(RadTreeNode);
            RadTreeNode objTemp =null;
            if (currentNode.Nodes.Count > 0)
            objTemp = currentNode.Nodes[0];
            else
            objTemp = null;
            if (objTemp == null)
            {
            return;
            // menu thi hanh
            }
            else
            {
            while ((objTemp != null))
            {
                CheckFunctionTree(objTemp, _dt,ref OK);
                objTemp = objTemp.Next;
            }
            currentNode.CollapseChildNodes();
            DataRow[] _Row = _dt.Select("MenuId = " + currentNode.Value.ToString());
            if (_Row.Length > 0)
            {
                currentNode.Checked = true;
                OK = true;
            }
            foreach (RadTreeNode objTreeNode in currentNode.Nodes)
            {
                DataRow[] _Row1 = _dt.Select("MenuId = " + objTreeNode.Value.ToString());
                if (_Row1.Length > 0)
                {
                    objTreeNode.Checked = true;
                    OK = true;
                }

            }

            }
            }
            catch (Exception ex)
            {

            }
        }
开发者ID:chutinhha,项目名称:web-quan-ly-kho,代码行数:47,代码来源:Authority_Group.aspx.cs

示例4: InitWebServiceNodes

    protected void InitWebServiceNodes(XmlDocument doc, string event_field, RadTreeNode url_node,
        RadTreeNode WebServiceResponseRoot, XmlNode phone_data_requests)
    {
        string url = url_node.Text;
        url_node.ExpandParentNodes();
        url_node.CollapseChildNodes();
        Hashtable WebServiceMethodInputs = new Hashtable();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        State["WebServiceMethodInputs"] = WebServiceMethodInputs;
        RadTreeNode out_url = new RadTreeNode(url);
        out_url.CssClass = "RadTreeView";
        out_url.ImageUrl = "~/images/dialog.gif";
        WebServiceResponseRoot.Nodes.Add(out_url);

        Util util = new Util();

        if (!url.EndsWith("?WSDL"))
            url += "?WSDL";
        string xml = util.GetWebPage(url);
        if (xml == null)
        {
            SaveRequestMessage.Text = "Accessing " + url + " resulted in an error";
            return;
        }
        XmlDocument WebDoc = new XmlDocument();
        WebDoc.LoadXml(xml);
        XmlNamespaceManager nsmgr = new XmlNamespaceManager(WebDoc.NameTable);
        nsmgr.AddNamespace("s", "http://www.w3.org/2001/XMLSchema");

        XmlNodeList web_methods = WebDoc.SelectNodes("//s:schema/s:element", nsmgr);
        if (web_methods.Count == 0)
        {
            nsmgr.AddNamespace("wsdl", "http://schemas.xmlsoap.org/wsdl/");
            web_methods = WebDoc.SelectNodes("//wsdl:operation", nsmgr);
            if (web_methods.Count == 0)
            {
                SaveRequestMessage.Text = "Could not find any methods with URL: " + url;
                return;
            }
        }
        Hashtable used_names = new Hashtable();
        foreach (XmlNode web_method in web_methods)
        {
            //throw out certain methods with <s:any />
            if (web_method.InnerXml.Contains("s:any"))
                continue;
            string web_method_name = web_method.Attributes["name"].Value;
            if (used_names.ContainsKey(web_method_name))
                continue;
            used_names[web_method_name] = true;
            ArrayList MethodInputs = new ArrayList();
            string service_url = out_url.Text;
            if (out_url.Text.ToLower().EndsWith("?wsdl"))
                service_url = service_url.Remove(url.Length - 5);
            WebServiceMethodInputs[service_url + "/" + web_method_name] = MethodInputs;
            RadTreeNode in_method_node = new RadTreeNode(web_method_name);
            in_method_node.CssClass = "RadTreeView";
            in_method_node.ImageUrl = "~/images/forward_nav.gif";
            url_node.Nodes.Add(in_method_node);

            //response web methods
            XmlNode mapped_node = phone_data_requests.SelectSingleNode("//event_field[.='" + event_field + "']");
            RadTreeNode out_method_node = null;
            if (mapped_node != null &&  State["WebServiceTestDoc"] != null &&  State["WebServiceResponseTreeViewNodeText"] != null &&
                  State["WebServiceResponseTreeViewNodeText"].ToString() == web_method_name)
            {
                //make sure we are in the right event
                XmlNode method_node = mapped_node.ParentNode.SelectSingleNode("method");
                if (method_node != null && method_node.InnerText == web_method_name)
                {
                    XmlDocument TestDoc = (XmlDocument) State["WebServiceTestDoc"];
                    out_method_node = new RadTreeNode(web_method_name);
                     State["WebServiceResponseTreeViewMethodText"] = web_method_name;
                    out_method_node.CssClass = "RadTreeView";
                    out_method_node.ImageUrl = "~/images/backward_nav.gif";
                    out_method_node.Category = "method";
                    out_method_node.Value = service_url + ";" + web_method_name + ";";
                    out_url.Nodes.Add(out_method_node);
                    out_method_node.Value.Remove(out_method_node.Value.Length - 1, 1);
                    WebServiceResponseTreeView.ExpandAllNodes();

                    XmlToTreeViewNode(TestDoc.FirstChild.NextSibling, out_method_node, web_method_name);

                    out_method_node.ExpandParentNodes();

                    Session.Remove("WebServiceTestDoc");
                }
            }
            else if (mapped_node != null)
            {
                XmlNode web_service_node = mapped_node.ParentNode.SelectSingleNode("web_service[.='" + service_url + "']");
                XmlNode method_node = mapped_node.ParentNode.SelectSingleNode("method[.='" + web_method_name + "']");
                if (web_service_node != null && method_node != null)
                {
                    in_method_node.BackColor = Color.LightCoral;

                    out_method_node = new RadTreeNode(web_method_name);
                    out_method_node.CssClass = "RadTreeView";
                    out_method_node.ImageUrl = "~/images/backward_nav.gif";
                    out_method_node.Category = "method";
//.........这里部分代码省略.........
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:101,代码来源:ManageData.aspx.cs


注:本文中的RadTreeNode.CollapseChildNodes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。