asp.net.ph

DataColumn.Caption Property

System.Data Namespace   DataColumn Class


Sets or retrieves the caption for the column.

Syntax


Script DataColumn.Caption [ = strCaption ]

Property Value


strCaption The caption of the column. If not set, returns the ColumnName value.

The property is read/write with no default value.

Remarks

The Caption value becomes visible in controls that support its display. For example, the System.Windows.Forms.DataGrid control is capable of displaying captions for each column.

Example

The following example initializes a new DataColumn and adds it to a DataColumnCollection.

private void SetCaption ( ) {
   DataColumn myColumn = new DataColumn ( "fName" );
   // set a different Caption.
   myColumn.Caption = "First Name";
}
  C# VB

See Also

DataColumn Members   ColumnName Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph