System.Web.UI.WebControls Namespace BoundColumn Class
Initializes a new instance of the BoundColumn class.
[ VB ]
Public Sub New ( )
[ C# ]
public BoundColumn ( );
[ C++ ]
public: BoundColumn ( );
[ JScript ]
public function BoundColumn ( );
Use this constructor to initialize a new instance of the BoundColumn class.
The following example demonstrates how to initialize a new instance of the BoundColumn class and add it to the Columns collection.
void Page_Init ( Object src, EventArgs e ) {
// create dynamic column to add to Columns collection.
BoundColumn newColumn = new BoundColumn ( );
newColumn.HeaderText = "Product Code";
newColumn.DataField = "ProductID";
// add column to Columns collection.
myGrid.Columns.AddAt ( 2, newColumn );
}
Sub Page_Init ( src As Object, e As EventArgs )
' create dynamic column to add to Columns collection.
Dim newColumn As New BoundColumn ( )
newColumn.HeaderText = "Product Code"
newColumn.DataField = "ProductID"
' add column to Columns collection.
myGrid.Columns.AddAt ( 2, newColumn )
End Sub |
|
C# |
VB |
BoundColumn Members Adding Bound Columns to a DataGrid Control