Пример #1
0
        private void Edit_DataBinding(object sender, EventArgs e)
        {
            TimDropDownList ddlEdit = (TimDropDownList)sender;
            object          value   = this.GetValue(ddlEdit.NamingContainer);

            ddlEdit.Text = this.FormatDataValue(value, this.HtmlEncode);
        }
Пример #2
0
        protected override void InitializeDataCell(DataControlFieldCell cell, DataControlRowState rowState)
        {
            TimDropDownList ddlEdit = new TimDropDownList();

            ddlEdit.ID = "ddl" + this.DataField;
            bool flag = base.Visible && base.ItemStyle.Width.Value > 2.0;

            if (flag)
            {
                ddlEdit.Width = new Unit(base.ItemStyle.Width.Value - 2.0);
            }
            else
            {
                ddlEdit.Width = base.ItemStyle.Width;
            }
            ddlEdit.Enabled = this.Enabled;
            bool flag2 = this.TextChanged != null;

            if (flag2)
            {
                ddlEdit.AutoPostBack = true;
                ddlEdit.TextChanged += new EventHandler(this.TextChanged.Invoke);
            }
            ddlEdit.DataBinding += new EventHandler(this.Edit_DataBinding);
            cell.Controls.Add(ddlEdit);
        }