DataGridBoolColumn.TrueValue Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the actual value used when setting the value of the column to true
.
public:
property System::Object ^ TrueValue { System::Object ^ get(); void set(System::Object ^ value); };
[System.ComponentModel.TypeConverter(typeof(System.ComponentModel.StringConverter))]
public object TrueValue { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.ComponentModel.StringConverter))>]
member this.TrueValue : obj with get, set
Public Property TrueValue As Object
The value, typed as Object.
- Attributes
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 = dynamic_cast<DataGridBoolColumn^>(myDataGrid->TableStyles[ "Customers" ]->GridColumnStyles[ "Current" ]);
// Set TrueValue, FalseValue, and NullValue.
myGridColumn->TrueValue = true;
myGridColumn->FalseValue = false;
myGridColumn->NullValue = Convert::DBNull;
}
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;
}
Private Sub SetBoolColumnValues()
Dim myGridColumn As DataGridBoolColumn
' Get the DataGridBoolColumn you are setting.
myGridColumn = CType(myDataGrid.TableStyles _
("Customers").GridColumnStyles("Current"), DataGridBoolColumn)
' Set TrueValue, FalseValue, and NullValue.
myGridColumn.TrueValue = true
myGridColumn.FalseValue = false
myGridColumn.NullValue = Convert.DBNull
End Sub
The FalseValue, NullValue, and TrueValue properties determine the actual values pushed into the data source.
제품 | 버전 |
---|---|
.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 |
.NET 피드백
.NET은(는) 오픈 소스 프로젝트입니다. 다음 링크를 선택하여 피드백을 제공해 주세요.