System.Windows.Forms.GridColumnStylesCollection.IndexOf Method

Gets the index of a specified System.Windows.Forms.DataGridColumnStyle.

Syntax

public int IndexOf (DataGridColumnStyle element)

Parameters

element
The System.Windows.Forms.DataGridColumnStyle to find.

Returns

The zero-based index of the System.Windows.Forms.DataGridColumnStyle within the System.Windows.Forms.GridColumnStylesCollection or -1 if no corresponding System.Windows.Forms.DataGridColumnStyle exists.

Remarks

Use the GridColumnStylesCollection.Contains(System.ComponentModel.PropertyDescriptor) method to determine if a specific System.Windows.Forms.DataGridColumnStyle exists. If so, and you need the index of the element within the collection, use the GridColumnStylesCollection.IndexOf(DataGridColumnStyle) method.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0