Class GridCheckBoxColumn
Represents a column that used to display and edit boolean values and draw CheckBox in its cell.
Inheritance
Inherited Members
Namespace: Syncfusion.WinForms.DataGrid
Assembly: Syncfusion.SfDataGrid.WinForms.dll
Syntax
public class GridCheckBoxColumn : GridColumn, IDisposable, IFilterDefinition
Examples
The following example shows how to create the check box column.
GridCheckBoxColumn column1 = new GridCheckBoxColumn();
column1.MappingName = "Delivered";
column1.ThreeState = true;
column1.AllowText = true;
column1.CheckBoxSize = new Size(25,25);
sfDataGrid1.Columns.Add(column1);
Constructors
GridCheckBoxColumn()
Initializes a new instance of the GridCheckBoxColumn class.
Declaration
public GridCheckBoxColumn()
Properties
AllowCheckBoxOnHeader
Gets or sets a value indicating whether to enable check box in header.
Declaration
[Cloneable(true)]
public virtual bool AllowCheckBoxOnHeader { get; set; }
Property Value
Type |
---|
System.Boolean |
Examples
The following example shows how to enable check box for column header.
GridCheckBoxColumn column1 = new GridCheckBoxColumn();
column1.MappingName = "PaidStatus";
column1.AllowCheckBoxOnHeader = true;
sfDataGrid1.Columns.Add(column1);
AllowText
Gets or sets a value indicating whether to render the text along with check box in cell.
Declaration
[Cloneable(true)]
public bool AllowText { get; set; }
Property Value
Type |
---|
System.Boolean |
AllowThreeState
Gets or sets a value indicating whether the check box cells will allow three check states rather than two.
Declaration
[Cloneable(true)]
public bool AllowThreeState { get; set; }
Property Value
Type |
---|
System.Boolean |
CheckBoxSize
Gets or sets a value indicating the size of the check box.
Declaration
[Cloneable(true)]
public Size CheckBoxSize { get; set; }
Property Value
Type |
---|
System.Drawing.Size |
FalseValue
Gets or sets the underlying value corresponding to a cell value of false, which appears as an unchecked box.
Declaration
[Cloneable(true)]
public object FalseValue { get; set; }
Property Value
Type |
---|
System.Object |
Examples
The following example shows how to change the true value of the check box.
GridCheckBoxColumn column1 = new GridCheckBoxColumn();
column1.MappingName = "PaidStatus";
column1.ThreeState = true;
column1.FalseValue = PaidStatus.NotPaid;
sfDataGrid1.Columns.Add(column1);
IndeterminateValue
Gets or sets the underlying value corresponding to an indeterminate or null cell value, which appears as a disabled checkbox.
Declaration
[Cloneable(true)]
public object IndeterminateValue { get; set; }
Property Value
Type |
---|
System.Object |
Examples
The following example shows how to change the true value of the check box.
GridCheckBoxColumn column1 = new GridCheckBoxColumn();
column1.MappingName = "PaidStatus";
column1.ThreeState = true;
column1.IndeterminateValue = PaidStatus.UnKnown;
sfDataGrid1.Columns.Add(column1);
TrueValue
Gets or sets the underlying value corresponding to a cell value of true, which appears as an checked box.
Declaration
[Cloneable(true)]
public object TrueValue { get; set; }
Property Value
Type |
---|
System.Object |
Examples
The following example shows how to change the true value of the check box.
GridCheckBoxColumn column1 = new GridCheckBoxColumn();
column1.MappingName = "PaidStatus";
column1.ThreeState = true;
column1.TrueValue = PaidStatus.Paid;
sfDataGrid1.Columns.Add(column1);