DataGridBoolColumn.TrueValue Property

 

Gets or sets the actual value used when setting the value of the column to true.

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

[TypeConverterAttribute(typeof(StringConverter))]
public object TrueValue { get; set; }

Property Value

Type: System.Object

The value, typed as Object.

The FalseValue, NullValue, and TrueValue properties determine the actual values pushed into the data source.

The following code example sets the TrueValue, FalseValue, and NullValue properties of a DataGridBoolColumn.

private void SetBoolColumnValues(){
   DataGridBoolColumn myGridColumn;
   // Get the DataGridBoolColumn you are setting.
   myGridColumn = (DataGridBoolColumn) myDataGrid.
   TableStyles["Customers"].GridColumnStyles["Current"];
   // Set TrueValue, FalseValue, and NullValue.
   myGridColumn.TrueValue = true;
   myGridColumn.FalseValue = false;
   myGridColumn.NullValue = Convert.DBNull;
}


.NET Framework
Available since 1.1
Return to top
Show: