System.Web.UI.WebControls Namespace BoundField Class
.NET Framework version 2.0
Initializes a new instance of the BoundField class.
[ VB ]
Public Sub New ( )
[ C# ]
public BoundField ( );
[ C++ ]
public: BoundField ( );
[ JScript ]
public function BoundField ( );
Use this constructor to initialize a new instance of the BoundField class.
The following example demonstrates how to initialize a new instance of the BoundField class and add it to the Columns collection.
void Page_Init ( Object src, EventArgs e ) {
// create dynamic column to add to Columns collection.
BoundField newColumn = new BoundField ( );
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 BoundField ( )
newColumn.HeaderText = "Product Code"
newColumn.DataField = "ProductID"
' add column to Columns collection.
myGrid.Columns.AddAt ( 2, newColumn )
End Sub |
|
C# |
VB |
BoundField Members