DataGridViewCheckBoxColumn::DefaultCellStyle Property

 

Gets or sets the column's default cell style.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
[BrowsableAttribute(true)]
property DataGridViewCellStyle^ DefaultCellStyle {
	virtual DataGridViewCellStyle^ get() override;
	virtual void set(DataGridViewCellStyle^ value) override;
}

Property Value

Type: System.Windows.Forms::DataGridViewCellStyle^

The DataGridViewCellStyle to be applied as the default style.

The default DataGridViewCellStyle returned by this property has the following initial property values:

DataGridViewCellStyle property

Default value

Alignment

DataGridViewContentAlignment::MiddleCenter

NullValue

CheckState::Indeterminate if the initial ThreeState property value is true; otherwise, false.

These values override the value specified in the DefaultCellStyle property of the DataGridView control, but may be overridden by other cell style properties. For more information, see Cell Styles in the Windows Forms DataGridView Control.

If the NullValue property of the object returned by the DefaultCellStyle property has a value of false, changing the ThreeState property value to true automatically sets NullValue to Indeterminate. If NullValue has a value of Indeterminate, changing the ThreeState property value to false automatically sets NullValue to false.

The following code example demonstrates the use of this property.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: