Represents a collection of System.Windows.Forms.DataGridColumnStyle objects in the System.Windows.Forms.DataGrid control.
See Also: GridColumnStylesCollection Members
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.
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.