System.Windows.Forms.GridColumnStylesCollection Class

Represents a collection of System.Windows.Forms.DataGridColumnStyle objects in the System.Windows.Forms.DataGrid control.

See Also: GridColumnStylesCollection Members

Syntax

[System.ComponentModel.ListBindable(false)]
[System.ComponentModel.Editor("System.Windows.Forms.Design.DataGridColumnCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
public class GridColumnStylesCollection : BaseCollection, IList

Remarks

On the System.Windows.Forms.DataGridTableStyle, you access the System.Windows.Forms.GridColumnStylesCollection through the DataGridTableStyle.GridColumnStyles property.

The System.Windows.Forms.GridColumnStylesCollection uses standard GridColumnStylesCollection.Add(DataGridColumnStyle) and GridColumnStylesCollection.Remove(DataGridColumnStyle) methods to manipulate the collection.

Use the GridColumnStylesCollection.Contains(System.ComponentModel.PropertyDescriptor) method to determine if a specific property value exists in the collection. Additionally, use the GridColumnStylesCollection.IndexOf(DataGridColumnStyle) method to determine the index of any System.Windows.Forms.DataGridColumnStyle object within the collection.

Note:

Always create System.Windows.Forms.DataGridColumnStyle objects and add them to the System.Windows.Forms.GridColumnStylesCollection before adding System.Windows.Forms.DataGridTableStyle objects to the System.Windows.Forms.GridTableStylesCollection. When you add an empty System.Windows.Forms.DataGridTableStyle with a valid DataGridTableStyle.MappingName value to the collection, System.Windows.Forms.DataGridColumnStyle objects are automatically generated for you. Consequently, an exception will be thrown if you try to add new System.Windows.Forms.DataGridColumnStyle objects with duplicate DataGridTableStyle.MappingName values to the System.Windows.Forms.GridColumnStylesCollection.

Requirements

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