This DataGridColumnStyle-derived class supports
columns that display strings and are editable using a standard text
box.
In addition to the base-class features, you can set optional
Format and FormatInfo, to
format numeric or DateTime values using the
standard .NET formatting strings. This enables the column style to
support Byte, DateTime,
Decimal, Double,
Int16, Int64,
UInt16, UInt64, and
Single types, in addition to string itself.
public class DataGridTextBoxColumn : DataGridColumnStyle {
// Public Constructors
public DataGridTextBoxColumn();
public DataGridTextBoxColumn(System.ComponentModel.PropertyDescriptor prop);
public DataGridTextBoxColumn(System.ComponentModel.PropertyDescriptor prop, bool isDefault);
public DataGridTextBoxColumn(System.ComponentModel.PropertyDescriptor prop, string format);
public DataGridTextBoxColumn(System.ComponentModel.PropertyDescriptor prop, string format, bool isDefault);
// Public Instance Properties
public string Format{set; get; }
public IFormatProvider FormatInfo{set; get; }
public override PropertyDescriptor PropertyDescriptor{set; } // overrides DataGridColumnStyle
public override bool ReadOnly{set; get; } // overrides DataGridColumnStyle
public virtual TextBox TextBox{get; }
// Protected Instance Methods
protected internal override void Abort(int rowNum); // overrides DataGridColumnStyle
protected internal override bool Commit(CurrencyManager dataSource, int rowNum); // overrides DataGridColumnStyle
protected internal override void ConcedeFocus(); // overrides DataGridColumnStyle
protected internal override void Edit(CurrencyManager source, int rowNum,
System.Drawing.Rectangle bounds, bool readOnly, string instantText,
bool cellIsVisible); // overrides DataGridColumnStyle
protected void EndEdit();
protected internal override void EnterNullValue(); // overrides DataGridColumnStyle
protected internal override int GetMinimumHeight(); // overrides DataGridColumnStyle
protected internal override int GetPreferredHeight(System.Drawing.Graphics g,
object value); // overrides DataGridColumnStyle
protected internal override Size GetPreferredSize(System.Drawing.Graphics g,
object value); // overrides DataGridColumnStyle
protected void HideEditBox();
protected internal override void Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds,
CurrencyManager source, int rowNum); // overrides DataGridColumnStyle
protected internal override void Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds,
CurrencyManager source, int rowNum, bool alignToRight); // overrides DataGridColumnStyle
protected internal override void Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds,
CurrencyManager source, int rowNum, System.Drawing.Brush backBrush,
System.Drawing.Brush foreBrush, bool alignToRight); // overrides DataGridColumnStyle
protected void PaintText(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string text,
bool alignToRight);
protected void PaintText(System.Drawing.Graphics g, System.Drawing.Rectangle textBounds, string text,
System.Drawing.Brush backBrush, System.Drawing.Brush foreBrush, bool alignToRight);
protected override void SetDataGridInColumn(DataGrid value); // overrides DataGridColumnStyle
protected internal override void UpdateUI(CurrencyManager source, int rowNum,
string instantText); // overrides DataGridColumnStyle
}