Item Property (Int32)
Collapse the table of content
Expand the table of content

GridTableStylesCollection.Item Property (Int32)


Gets the DataGridTableStyle specified by index.

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

public DataGridTableStyle this[
	int index
] { get; }


Type: System.Int32

The index of the DataGridTableStyle to get.

Property Value

Type: System.Windows.Forms.DataGridTableStyle

The DataGridTableStyle at the specified index.

Exception Condition

No item exists at the specified index.

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

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

private void GetGridTableByIndex()
   DataGridTableStyle myGridStyle = 
   myDataGrid.TableStyles[0] ;

.NET Framework
Available since 1.1
Return to top
© 2016 Microsoft