DataGridBoolColumn.TrueValue Property

Definition

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

[System.ComponentModel.TypeConverter(typeof(System.ComponentModel.StringConverter))]
public object TrueValue { get; set; }

Property Value

The value, typed as Object.

Attributes

Examples

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;
}

Remarks

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

Applies to

제품 버전
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0

See also