CheckEdit.EditValue Property
Gets or sets the editor’s edit value.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v24.2.dll
Declaration
Property Value
Type | Default | Description |
---|---|---|
Object | false | The editor’s edit value. |
Remarks
In the CheckEdit control, each state (checked, unchecked and indeterminate) corresponds to a certain value. The default “state - value” pairs are:
- Checked state corresponds to the true Boolean value.
- Unchecked state corresponds to the false Boolean value.
- Indeterminate state (see RepositoryItemCheckEdit.AllowGrayed) corresponds to the null value (Nothing in Visual Basic).
When the editor’s check state changes, a corresponding value is assigned to the editor’s edit value. Conversely, when the editor’s edit value is set to one of the three values above, the corresponding check state is enabled. For instance, when you assign false to the EditValue property, the editor switches to the Unchecked state. When a user enables the Checked state, the editor’s edit value is set to true.
To associate custom values with the control’s check states, see the RepositoryItemCheckEdit.ValueUnchecked, RepositoryItemCheckEdit.ValueChecked and RepositoryItemCheckEdit.ValueGrayed properties. In advanced cases, you can handle the RepositoryItemCheckEdit.QueryCheckStateByValue and RepositoryItemCheckEdit.QueryValueByCheckState events to dynamically convert check states to edit values and back.
The code sample below illustrates how to set the “On” and “Off” values to check edit’s states.
checkEdit1.Properties.ValueChecked = "On";
checkEdit1.Properties.ValueUnchecked = "Off";
checkEdit1.CheckedChanged += CheckEdit1_CheckedChanged1;
private void CheckEdit1_CheckedChanged1(object sender, EventArgs e)
{
var edit = (CheckEdit)sender;
XtraMessageBox.Show(string.Format("CheckEdit Value: {0}", edit.EditValue));
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the EditValue property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.