Export (0) Print
Expand All

GridTableStylesCollection.Item Property (String)

Gets the DataGridTableStyle with the specified name.

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

public DataGridTableStyle this[
	string tableName
] { get; }

Parameters

tableName
Type: System.String

The MappingName of the DataGridTableStyle to retrieve.

When retrieving a DataGridTableStyle by MappingName, the Item property uses a case-insensitive comparison.

Use the Add or AddRange method to add items to the collection.

The following code example returns a DataGridTableStyle from the GridTableStylesCollection by passing the MappingName to the Item property.

private void GetGridTableByName()
{
   DataGridTableStyle myGridStyle = 
   myDataGrid.TableStyles["customers"] ;
   Console.WriteLine(myGridStyle.MappingName);
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft