DataGridBoolColumn.AllowNull Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets a value indicating whether null values are allowed.

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

public bool AllowNull { get; set; }

Property Value

Type: System.Boolean

true if null values are allowed, otherwise, false. The default is true.

When this property is set to false, the check boxes in the column have only two states: checked (true) and unchecked (false).

The following code example sets the AllowNull property.

private void SetAllowNull(){
    DataGridBoolColumn myGridColumn = (DataGridBoolColumn)dataGrid1.TableStyles[0].GridColumnStyles[0];
    myGridColumn.AllowNull = false;
 }

.NET Framework
Available since 1.1
Return to top
Show: