/// <summary> /// Creates a <see cref="TextBox"/> control to use for rendering the <see cref="BocTextValueBase"/> control in edit mode. /// </summary> /// <returns>A <see cref="TextBox"/> control with the all relevant properties set and all appropriate styles applied to it.</returns> protected virtual TextBox GetTextBox(BocRenderingContext <T> renderingContext) { TextBox textBox = new RenderOnlyTextBox { ClientIDMode = ClientIDMode.Static }; textBox.Text = renderingContext.Control.Text; textBox.ID = renderingContext.Control.GetValueName(); textBox.EnableViewState = false; textBox.Enabled = renderingContext.Control.Enabled; textBox.ReadOnly = !renderingContext.Control.Enabled; textBox.Width = Unit.Empty; textBox.Height = Unit.Empty; textBox.ApplyStyle(renderingContext.Control.CommonStyle); renderingContext.Control.TextBoxStyle.ApplyStyle(textBox); return(textBox); }
/// <summary> /// Creates a <see cref="TextBox"/> control to use for rendering the <see cref="BocTextValueBase"/> control in edit mode. /// </summary> /// <returns>A <see cref="TextBox"/> control with the all relevant properties set and all appropriate styles applied to it.</returns> protected virtual TextBox GetTextBox(BocRenderingContext <T> renderingContext) { TextBox textBox = new RenderOnlyTextBox { Text = renderingContext.Control.Text }; textBox.ID = renderingContext.Control.GetValueName(); textBox.EnableViewState = false; textBox.Enabled = renderingContext.Control.Enabled; textBox.ReadOnly = !renderingContext.Control.Enabled; textBox.Width = Unit.Empty; textBox.Height = Unit.Empty; textBox.ApplyStyle(renderingContext.Control.CommonStyle); renderingContext.Control.TextBoxStyle.ApplyStyle(textBox); if (textBox.TextMode == TextBoxMode.MultiLine && textBox.Columns < 1) { textBox.Columns = c_defaultColumns; } return(textBox); }