Gets a value indicating whether the TBD contains a specific DataGridColumn.
Gets a value indicating whether the TBD contains a DataGridColumn associated with the specified DataColumn.
[Visual Basic] Overloads Public Function Contains(DataColumn) As Boolean
[C#] public bool Contains(DataColumn);
[C++] public: bool Contains(DataColumn*);
[JScript] public function Contains(DataColumn) : Boolean;
Gets a value indicating whether the TBD contains the specified DataGridColumn.
[Visual Basic] Overloads Public Function Contains(DataGridColumn) As Boolean
[C#] public bool Contains(DataGridColumn);
[C++] public: bool Contains(DataGridColumn*);
[JScript] public function Contains(DataGridColumn) : Boolean;
Gets a value indicating whether the TBD contains the DataGridColumn with the specified name.
[Visual Basic] Overloads Public Function Contains(String) As Boolean
[C#] public bool Contains(String);
[C++] public: bool Contains(String*);
[JScript] public function Contains(String) : Boolean;
The following example uses the Contains method to determine if a DataGridColumn with a given name exists in the GridColumnsCollection. If so, the code prints the value of the first row in the grid using the GetColumnValueAtRow method.
Note This example shows how to use one of the overloaded versions of Contains. For other examples that may be available, see the individual overload topics.
[Visual Basic]
Private Sub GetThisColumn() Dim trueOrFalse As Boolean Dim findString As String findString = "FName" trueOrFalse = DataGrid1.GridColumns.Contains(findString) If trueOrFalse Then Debug.Print DataGrid1.GridColumns(findString). _ GetColumnValueAtRow(DataGrid1.DataSource, 0) End If End Sub
GridColumnsCollection Class | GridColumnsCollection Members | System.WinForms Namespace