NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataGridTextBoxColumn Constructor (PropertyDescriptor, Format)

Initializes a new instance of a DataGridTextBoxColumn. with the specified TBD and Format.

[Visual Basic]
Overloads Public Sub New( _
   ByVal prop As PropertyDescriptor, _
   ByVal format As Format _
)
[C#]
public DataGridTextBoxColumn(
   PropertyDescriptor prop,
   Format format
);
[C++]
public: DataGridTextBoxColumn(
   PropertyDescriptor* prop,
   Format* format
);
[JScript]
public function DataGridTextBoxColumn(
   prop : PropertyDescriptor,
   format : Format
);

Parameters

prop
The TBD to be associated with the DataGridTextBoxColumn.
format
The Format used to format the column values.

Remarks

The TBD derives from DataGridColumn, and must therefore be associated with a DataColumn.

CAUTION   Once a TBD is associated with a DataColumn, attempting to reset the System.WinForms.DataGridColumn.DataColumn property can produce unpredictable results.

Notes to Inheritors: The TBD derives from DataGridColumn.

Example [Visual Basic]

The following example creates an instance of a TBD and associates it with both a DataColumn and a Format.

[Visual Basic]

Private Sub MakeDataGridTextBoxCol()
   Dim dc As New DataColumn
   Set dc.DataType = [type].GetType("System.DateTime")
   dc.ColumnName = "DateTime"
   dc.DefaultValue = now
   DataGrid1.DataGridTable.DataTable.Columns.Add dc
   Dim fmt As New System.WinForms.ComponentModel.DateTimeFormat
   Dim dgeCol As DataGridTextBoxColumn
   Set dgeCol = New DataGridTextBoxColumn(dc, fmt)
   DataGrid1.GridColumns.Add dgeCol    
End Sub

See Also

DataGridTextBoxColumn Class | DataGridTextBoxColumn Members | System.WinForms Namespace | DataGridTextBoxColumn Constructor Overload List | DataColumn | DataGridColumn | DataGrid | Format