Esempio n. 1
0
        //***************************************************************************
        // Private Methods
        //
        protected override void CreateChildControls()
        {
            Panel pnl = FormElementControl.CreateControlContainer(this._qData, this.EditMode);

            this.Controls.Add(pnl);
            this.ControlContainer = pnl;

            ListBox lst = new ListBox();

            pnl.Controls.Add(lst);
            lst.ID = "lstElement_" + this._qData.ElementProviderKey.ToString();
            lst.ValidationGroup = "DynamicForm_" + this._qData.FormProviderKey.ToString();
            if (this._qData.ElementWidth != Unit.Empty)
            {
                lst.Width = this._qData.ElementWidth;
            }
            if (this._qData.ElementHeight != Unit.Empty)
            {
                lst.Height = this._qData.ElementHeight;
            }
            foreach (FormElementDataAnswer item in this._qData.Answers.OrderBy(a => a.OrdinalPosition))
            {
                lst.Items.Add(new ListItem(item.AnswerText, item.AnswerProviderKey.ToString()));
            }
            this.AnswerControl = lst;

            base.CreateChildControls();
        }
        //***************************************************************************
        // Private Methods
        //
        protected override void CreateChildControls()
        {
            Panel pnl = FormElementControl.CreateControlContainer(this._qData, this.EditMode);

            this.Controls.Add(pnl);
            this.ControlContainer = pnl;

            Image img = new Image();

            pnl.Controls.Add(img);
            img.ID       = "imgElement_" + this._qData.ElementProviderKey.ToString();
            img.ImageUrl = this._qData.ImageUrl;
            if (this._qData.ImageAlignment != ImageAlign.NotSet)
            {
                img.ImageAlign = this._qData.ImageAlignment;
            }
            if (this._qData.ElementWidth != Unit.Empty)
            {
                img.Width = this._qData.ElementWidth;
            }
            if (this._qData.ElementHeight != Unit.Empty)
            {
                img.Height = this._qData.ElementHeight;
            }
            img.AlternateText = this._qData.HintText;

            base.CreateChildControls();
        }
        //***************************************************************************
        // Private Methods
        //
        protected override void CreateChildControls()
        {
            Panel pnl = FormElementControl.CreateControlContainer(this._qData, this.EditMode);

            this.Controls.Add(pnl);
            this.ControlContainer = pnl;

            base.CreateChildControls();
        }
Esempio n. 4
0
        //***************************************************************************
        // Private Methods
        //
        protected override void CreateChildControls()
        {
            Panel pnl = FormElementControl.CreateControlContainer(this._qData, this.EditMode);

            this.Controls.Add(pnl);
            this.ControlContainer = pnl;

            RadioButtonList rdo = new RadioButtonList();

            pnl.Controls.Add(rdo);
            rdo.ID = "rdoLstElement_" + this._qData.ElementProviderKey.ToString();
            if (this._qData.ElementWidth != Unit.Empty)
            {
                rdo.Width = this._qData.ElementWidth;
            }

            if (this._qData.HasHorizontalOption)
            {
                rdo.RepeatDirection = RepeatDirection.Horizontal;
            }
            else
            {
                rdo.RepeatDirection = RepeatDirection.Vertical;
            }

            if (this._qData.HasHorizontalOption && this._qData.HasVerticalOption)
            {
                throw new Exception("You cannot specify both the horizontal and vertical display options for an element.  ProviderKey: " + this._qData.ElementProviderKey.ToString());
            }

            else if (this._qData.HasHorizontalOption)
            {
                if (this._qData.ColumnCount > 0)
                {
                    rdo.RepeatLayout  = RepeatLayout.Table;
                    rdo.RepeatColumns = this._qData.ColumnCount;
                }
                else
                {
                    rdo.RepeatLayout = RepeatLayout.Flow;
                }
            }
            else
            {
                rdo.RepeatLayout = RepeatLayout.Table;
            }

            foreach (FormElementDataAnswer item in this._qData.Answers.OrderBy(a => a.OrdinalPosition))
            {
                rdo.Items.Add(new ListItem(item.AnswerText, item.AnswerProviderKey.ToString()));
            }

            this.AnswerControl = rdo;

            base.CreateChildControls();
        }
Esempio n. 5
0
        //***************************************************************************
        // Private Methods
        //
        protected override void CreateChildControls()
        {
            Panel pnl = FormElementControl.CreateControlContainer(this._qData, this.EditMode);

            this.Controls.Add(pnl);
            this.ControlContainer = pnl;

            TextBox txt = new TextBox();

            pnl.Controls.Add(txt);
            txt.ID = "txtElement_" + this._qData.ElementProviderKey.ToString();
            if (this._qData.ElementWidth != Unit.Empty)
            {
                txt.Width = this._qData.ElementWidth;
            }
            if (this._qData.ElementHeight != Unit.Empty)
            {
                txt.Height = this._qData.ElementHeight;
            }
            if (this._qData.BackColor != System.Drawing.Color.Empty)
            {
                txt.BackColor = this._qData.BackColor;
            }
            if (this._qData.ForeColor != System.Drawing.Color.Empty)
            {
                txt.ForeColor = this._qData.ForeColor;
            }
            if (this._qData.BorderColor != System.Drawing.Color.Empty)
            {
                txt.BorderColor = this._qData.BorderColor;
            }
            if (this._qData.BorderStyle != BorderStyle.NotSet)
            {
                txt.BorderStyle = this._qData.BorderStyle;
            }
            if (this._qData.BorderWidth != Unit.Empty)
            {
                txt.BorderWidth = this._qData.BorderWidth;
            }
            this.AnswerControl     = txt;
            this.ValidationControl = txt;
            txt.TextChanged       += new EventHandler(this.TextChanged);

            if (!string.IsNullOrEmpty(this._qData.Suffix))
            {
                pnl.Controls.Add(new LiteralControl(string.Format("<span class=\"formElementSuffix\">{0}</span>", this._qData.Suffix)));
            }

            base.CreateChildControls();
        }
        //***************************************************************************
        // Private Methods
        //
        protected override void CreateChildControls()
        {
            string idVal = this._qData.ElementProviderKey.ToString();

            Panel pnl = FormElementControl.CreateControlContainer(this._qData, this.EditMode);

            this.Controls.Add(pnl);
            this.ControlContainer = pnl;

            this._hdnFld = new HiddenField();
            pnl.Controls.Add(this._hdnFld);
            this._hdnFld.ID    = "hdnElementValue_" + idVal;
            this._hdnFld.Value = (this._qData.Answers.Count > 0 ? this._qData.Answers[0].AnswerProviderKey.ToString() : string.Empty);
            this.AnswerControl = this._hdnFld;

            base.CreateChildControls();
        }
        //***************************************************************************
        // Private Methods
        //
        protected override void CreateChildControls()
        {
            Panel pnl = FormElementControl.CreateControlContainer(this._qData, this.EditMode);

            this.Controls.Add(pnl);
            this.ControlContainer = pnl;

            HyperLink lnk = new HyperLink();

            pnl.Controls.Add(lnk);
            lnk.ID          = "lnkElement_" + this._qData.ElementProviderKey.ToString();
            lnk.Text        = this._qData.Text;
            lnk.Target      = "_blank";
            lnk.NavigateUrl = this._qData.NavigationUrl;

            base.CreateChildControls();
        }
Esempio n. 8
0
        //***************************************************************************
        // Private Methods
        //
        protected override void CreateChildControls()
        {
            Panel pnl = FormElementControl.CreateControlContainer(this._qData, this.EditMode);

            this.Controls.Add(pnl);
            this.ControlContainer = pnl;

            DropDownList drp = new DropDownList();

            pnl.Controls.Add(drp);
            drp.AutoPostBack = true;
            drp.ID           = "drpElement_" + this._qData.ElementProviderKey.ToString();
            if (this._qData.ElementWidth != Unit.Empty)
            {
                drp.Width = this._qData.ElementWidth;
            }
            if (this._qData.ElementHeight != Unit.Empty)
            {
                drp.Height = this._qData.ElementHeight;
            }
            if (this._qData.BackColor != System.Drawing.Color.Empty)
            {
                drp.BackColor = this._qData.BackColor;
            }
            if (this._qData.ForeColor != System.Drawing.Color.Empty)
            {
                drp.ForeColor = this._qData.ForeColor;
            }

            drp.Items.Add(new ListItem("- Select -", ""));
            foreach (FormElementDataAnswer item in this._qData.Answers.OrderBy(a => a.OrdinalPosition))
            {
                drp.Items.Add(new ListItem(item.AnswerText, item.AnswerProviderKey.ToString()));
            }

            this.AnswerControl = drp;

            base.CreateChildControls();
        }