asp.net.ph

DataGridColumnCollection.Item Property

System.Web.UI.WebControls Namespace   DataGridColumnCollection Class


Returns a DataGridColumn object at the specified index in the collection.

In [ C# ], this property is the indexer for the DataGridColumnCollection class.

[ VB ]
Public Default ReadOnly Property Item ( _
   ByVal index As Integer _
) As Column

[ C# ]
public Column this [ 
   int index
 ] {get;}

[ C++ ]
public: __property Column* get_Item (
   int index
);

[ JScript ]
returnValue=ColumnCollectionObject.Item ( index );
-or-
returnValue=ColumnCollectionObject ( index );

Parameters

index
The zero-based index of the DataGridColumn to retrieve in the collection.

Property Value

The DataGridColumn at the specified index in the collection.

Remarks

Use this indexer to get a DataGridColumn derived object from the DataGridColumnCollection at the specified index using array notation.

Example

The following example demonstrates how to use the indexer to get a DataGridColumn derived object from a DataGridColumnCollection.

void showHeaders ( Object src, EventArgs e ) {
   myLabel.Text = "Header Text for each column: <br>";

   for ( int i = 0; i < myGrid.Columns.Count; i ++ ) {
      myLabel.Text += myGrid.Columns [ i ] .HeaderText + "<br>";
   }
}
  C# VB

See Also

DataGridColumnCollection Members 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