DataGridTableStyle::GridColumnStyles Property
Gets the collection of columns drawn for this table.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
public: property GridColumnStylesCollection^ GridColumnStyles { virtual GridColumnStylesCollection^ get(); }
Property Value
Type: System.Windows.Forms::GridColumnStylesCollection^A GridColumnStylesCollection that contains all DataGridColumnStyle objects for the table.
The GridColumnStylesCollection returned by the GridColumnStyles property allows you to create a customized set of column styles. For each DataColumn in a DataTable, set the MappingName of a DataGridColumnStyle to the ColumnName. That column style will automatically be used when this DataGridTableStyle is displayed.
If you create a DataGridTableStyle without adding any DataGridColumnStyle objects to the GridColumnStylesCollection, a collection of DataGridColumnStyle objects will be created automatically when a DataGridTableStyle with a valid MappingName is added to the GridTableStylesCollection. An exception will be thrown if you attempt to add DataGridColumnStyle objects with duplicate MappingName values to the collection.
The following code example gets the GridColumnStylesCollection of a DataGridTableStyle and prints each object's header.
Available since 1.1