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
)

Parameters

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.

void TestContains()
{
   bool isContained;
   isContained = myDataGrid->TableStyles->Contains( "Customers" );
   Console::WriteLine( isContained );
}

.NET Framework
Available since 1.1
Return to top
Show: