示例#1
0
        /// <summary>
        /// 手风琴样式菜单
        /// </summary>
        /// <returns></returns>
        private FineUI.Accordion InitAccordionMenu()
        {
            FineUI.Accordion accordionMenu = new FineUI.Accordion();
            accordionMenu.ID         = "accordionMenu";
            accordionMenu.EnableFill = true;
            accordionMenu.ShowBorder = false;
            accordionMenu.ShowHeader = false;
            regionLeft.Items.Add(accordionMenu);

            XmlDocument xmlDoc   = getXmlDocument();
            XmlNodeList xmlNodes = xmlDoc.SelectNodes("/Tree/TreeNode");

            foreach (XmlNode xmlNode in xmlNodes)
            {
                if (xmlNode.HasChildNodes)
                {
                    FineUI.AccordionPane accordionPane = new FineUI.AccordionPane();
                    accordionPane.Title       = xmlNode.Attributes["Text"].Value;
                    accordionPane.Layout      = FineUI.Layout.Fit;
                    accordionPane.ShowBorder  = false;
                    accordionPane.BodyPadding = "2px 0 0 0";
                    accordionMenu.Items.Add(accordionPane);

                    FineUI.Tree innerTree = new FineUI.Tree();
                    innerTree.ShowBorder              = false;
                    innerTree.ShowHeader              = false;
                    innerTree.EnableIcons             = true;
                    innerTree.AutoScroll              = true;
                    innerTree.EnableSingleClickExpand = true;
                    accordionPane.Items.Add(innerTree);

                    XmlDocument doc = new XmlDocument();
                    doc.LoadXml(String.Format("<?xml version=\"1.0\" encoding=\"utf-8\" ?><Tree>{0}</Tree>", xmlNode.InnerXml));

                    // 绑定AccordionPane内部的树控件
                    innerTree.NodeDataBound += treeMenu_NodeDataBound;
                    innerTree.DataSource     = doc;
                    innerTree.DataBind();
                }
            }
            return(accordionMenu);
        }
示例#2
0
        /// <summary>
        /// 树样式菜单
        /// </summary>
        /// <returns></returns>
        private FineUI.Tree InitTreeMenu()
        {
            FineUI.Tree treeMenu = new FineUI.Tree();
            treeMenu.ID                      = "treeMenu";
            treeMenu.ShowBorder              = false;
            treeMenu.ShowHeader              = false;
            treeMenu.AutoScroll              = true;
            treeMenu.EnableIcons             = true;
            treeMenu.EnableSingleClickExpand = true;
            regionLeft.Items.Add(treeMenu);

            XmlDocument doc = getXmlDocument();

            // 绑定 XML 数据源到树控件
            treeMenu.NodeDataBound += treeMenu_NodeDataBound;
            treeMenu.DataSource     = doc;
            treeMenu.DataBind();

            return(treeMenu);
        }