コード例 #1
0
        private void BindGrid()
        {
            Maticsoft.BLL.tPictureType BLL = new Maticsoft.BLL.tPictureType();

            TMailList.Nodes.Clear();
            DataSet ds = BLL.GetList(" id>0  order by Sort desc");

            ds.Relations.Add("TreeRelation", ds.Tables[0].Columns["id"], ds.Tables[0].Columns["FatherId"], false);



            foreach (DataRow row in ds.Tables[0].Rows)
            {
                if (row["FatherId"].ToString() == "0")
                {
                    FineUIPro.TreeNode node = new FineUIPro.TreeNode();
                    node.NodeID   = row["id"].ToString();
                    node.Text     = row["Name"].ToString();
                    node.Expanded = true;
                    if (row.GetChildRows("TreeRelation").Length <= 0)
                    {
                        node.ToolTip = "可选择";
                    }
                    else
                    {
                        node.ToolTip = "不可选择";
                    }
                    node.EnableClickEvent = true;
                    TMailList.Nodes.Add(node);
                    ResolveSubTree(row, node);
                }
            }
        }
コード例 #2
0
        private void BindGrid()
        {
            Maticsoft.BLL.tPictureType bll = new Maticsoft.BLL.tPictureType();
            DataSet ds = bll.GetList("");

            ds.Relations.Add("TreeRelation", ds.Tables[0].Columns["Id"], ds.Tables[0].Columns["FatherId"], false);
            ddlfatherId.Items.Clear();
            foreach (DataRow row in ds.Tables[0].Rows)
            {
                if (row["FatherId"].ToString() == "0")
                {
                    FineUIPro.ListItem it = new FineUIPro.ListItem();
                    it.Text              = row["Name"].ToString();
                    it.Value             = row["Id"].ToString();
                    it.SimulateTreeLevel = 1;
                    if (row.GetChildRows("TreeRelation").Length <= 0)
                    {
                        it.EnableSelect = true;
                    }
                    else
                    {
                        it.EnableSelect = false;
                    }
                    ddlfatherId.Items.Add(it);
                    ResolveSubTree(row, ddlfatherId);
                }
            }
        }