Gets a value indicating whether the System.Windows.Forms.GridColumnStylesCollection contains a System.Windows.Forms.DataGridColumnStyle associated with the specified System.ComponentModel.PropertyDescriptor.
- propertyDescriptor
- The System.ComponentModel.PropertyDescriptor associated with the desired System.Windows.Forms.DataGridColumnStyle.
true if the collection contains the System.Windows.Forms.DataGridColumnStyle; otherwise, false.
To get a System.ComponentModel.PropertyDescriptorCollection, use the BindingManagerBase.GetItemProperties method of the System.Windows.Forms.BindingManagerBase class. Pass the DataGridColumnStyle.MappingName of the System.Windows.Forms.DataGridColumnStyle to the System.ComponentModel.PropertyDescriptorCollection.Item(int) property of the System.ComponentModel.PropertyDescriptorCollection to return the System.ComponentModel.PropertyDescriptor for a specific column.
Use the GridColumnStylesCollection.Contains(System.ComponentModel.PropertyDescriptor) method to determine if a particular System.Windows.Forms.DataGridColumnStyle exists before invoking the GridColumnStylesCollection.Remove(DataGridColumnStyle) method to remove the item. If you need to know the index of a particular System.Windows.Forms.DataGridColumnStyle, use the GridColumnStylesCollection.IndexOf(DataGridColumnStyle) method.