GridTableStylesCollection.Contains Method (String)


Gets a value indicating whether the GridTableStylesCollection contains the DataGridTableStyle specified by name.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public bool Contains(
	string name


Type: System.String

The MappingName of the DataGridTableStyle to look for.

Return Value

Type: System.Boolean

true if the specified table style exists in the collection; otherwise, false.

The following code example uses the Contains method to determine if a DataGridTableStyle with the specified MappingName exists in the collection.

private void TestContains()
   bool isContained;
   isContained = myDataGrid.TableStyles.Contains("Customers");

.NET Framework
Available since 1.1
Return to top