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!

GridColumnsCollection.Item (String)

Gets the DataGridColumn with the specified name.

[C#] In C#, this member is the indexer for the GridColumnsCollection class.

[Visual Basic]
Overloads Public Default ReadOnly Property Item( _
   ByVal columnName As String _
) As DataGridColumn
[C#]
public DataGridColumn this[
   string columnName
] {get;}
[C++]
public: __property DataGridColumn* get_Item(
   String* columnName
);
[JScript]
returnValue = GridColumnsCollectionObject.Item(columnName);
-or-
returnValue = GridColumnsCollectionObject(columnName);

[JScript] In JScript, you can use the default indexed properties defined by a type, but you cannot explicitly define your own. However, specifying the expando attribute on a class automatically provides a default indexed Item property whose type is Object and whose index type is String.

Arguments [JScript]

columnName
The column header of the DataGridColumn to retrieve.

Parameters [Visual Basic, C#, C++]

columnName
The column header of the DataGridColumn to retrieve.

Property Value

The DataGridColumn with the specified column header.

Remarks

The column header of a DataGridColumn can be set explicitly by setting the Header property. If not set explicitly, the TBD uses the ColumnName value of the DataColumn object associated with the DataGridColumn object.

The comparison between column headers and the value to look for is not case-sensitive.

Example [Visual Basic]

The following example returns the DataGridColumn named in the Item property (GridColumnsCollection indexer).

[Visual Basic]

Dim gCol As DataGridColumn
' Presuming a DataGridColumn with the header "FName" exists.
Set gCol = DataGrid1.GridColumns("Fname")
Debug.Print gCol.GetType.ToString

See Also

GridColumnsCollection Class | GridColumnsCollection Members | System.WinForms Namespace | GridColumnsCollection.Item Overload List