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.
The DataGridColumn with the specified column header.
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.
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
GridColumnsCollection Class | GridColumnsCollection Members | System.WinForms Namespace | GridColumnsCollection.Item Overload List