예제 #1
0
        /// <summary>
        /// 创建行控件
        /// </summary>
        /// <param name="field">字段信息</param>
        /// <returns>行控件</returns>
        protected Control CreateItem(We7Control control)
        {
            //control.Type = "Text";
            control      = control.Clone() as We7Control;
            control.Type = "Text";

            HtmlTableRow  row = new HtmlTableRow();
            HtmlTableCell c   = new HtmlTableCell();

            c.InnerHtml           = GetLabel(control) + ":";
            c.Attributes["class"] = "formTitle";
            row.Cells.Add(c);

            c = new HtmlTableCell();
            c.Attributes["class"] = "formValue";
            FieldControl fc = UIHelper.GetControl(control);

            fc.IsEdit = IsEdit;
            c.Controls.Add(fc);

            Literal ltlMsg = new Literal();

            ltlMsg.Text = control.Desc;
            c.Controls.Add(ltlMsg);

            row.Cells.Add(c);

            row.Style.Add("display", control.Visible ? "" : "none");

            return(row);
        }
예제 #2
0
        /// <summary>
        /// 创建行控件
        /// </summary>
        /// <param name="field">字段信息</param>
        /// <returns>行控件</returns>
        protected Control CreateItem(We7Control control)
        {
            HtmlTableRow       row   = new HtmlTableRow();
            HtmlTableCell      c     = new HtmlTableCell("TH");
            HtmlGenericControl lable = new HtmlGenericControl("strong");

            lable.InnerHtml = control.Label + ":";
            c.Controls.Add(lable);
            row.Cells.Add(c);

            c = new HtmlTableCell();
            We7Control ctr = control.Clone() as We7Control;

            if (!EnableControls.Contains(ctr.Type))
            {
                ctr.Type = "Text";
            }
            FieldControl fc = UIHelper.GetControl(ctr);

            fc.IsEdit = IsEdit;
            c.Controls.Add(fc);
            row.Cells.Add(c);

            row.Style.Add("display", control.Visible ? "" : "none");

            return(row);
        }