Example #1
0
        protected override void InitializeDataCell(DataControlFieldCell cell, DataControlRowState rowState)
        {
            Control ctrl = null;

            if (this.EditMode || this.InsertMode)
            {
                HtmlEditor control = this.CreateControl();
                this.CopyProperties(control);
                control.Init += OnControlInit;
                if (!base.Visible)
                {
                    control.Required = false;
                }
                if (cell != null)
                {
                    cell.Controls.Add(control);
                }
                ctrl = control;
            }
            else
            {
                if (cell != null)
                {
                    cell.Style[HtmlTextWriterStyle.PaddingLeft] = "3px";
                }
                ctrl = cell;
            }

            if (ctrl != null && base.Visible)
            {
                ctrl.DataBinding += new EventHandler(this.OnBindingField);
            }
        }
Example #2
0
        private void OnBindingField(object sender, EventArgs e)
        {
            HtmlEditor control = sender as HtmlEditor;

            if (control != null)
            {
                if (!this.InsertMode)
                {
                    control.Content = this.LookupStringValue(control);
                }
            }
            else
            {
                TableCell cell = sender as TableCell;
                if (cell != null)
                {
                    cell.Text = this.LookupStringValue(cell);
                }
            }
        }
Example #3
0
        protected override object ExtractControlValue(Control control)
        {
            HtmlEditor editor = control as HtmlEditor;

            return((editor == null) ? string.Empty : editor.Content);
        }
Example #4
0
 private void CopyProperties(HtmlEditor control)
 {
     BaseValidatedField.CopyProperties(this, control);
     control.ToolTip = this.ToolTip;
 }