windowsforms-devexpress-dot-xtraeditors-dot-checkedit-b39fa9c9.md
Gets or sets the editor’s edit value.
Namespace : DevExpress.XtraEditors
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[Browsable(false)]
[DefaultValue(false)]
public override object EditValue { get; set; }
<Browsable(False)>
<DefaultValue(False)>
Public Overrides Property EditValue As Object
| Type | Default | Description |
|---|---|---|
| Object | false |
The editor’s edit value.
|
In the CheckEdit control, each state (checked, unchecked and indeterminate) corresponds to a certain value. The default “state - value” pairs are:
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));
}
checkEdit1.Properties.ValueChecked = "On"
checkEdit1.Properties.ValueUnchecked = "Off"
AddHandler checkEdit1.CheckedChanged, AddressOf CheckEdit1_CheckedChanged1
private void CheckEdit1_CheckedChanged1(Object sender, EventArgs e)
Dim edit = CType(sender, CheckEdit)
XtraMessageBox.Show(String.Format("CheckEdit Value: {0}", edit.EditValue))
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.
winforms-scheduler-sync-with-outlook/CS/SyncWithOutlook/SyncronizationOptionForm.cs#L29
private void SyncronizationOptionForm_Load(object sender, EventArgs e) {
checkEditAllowCreateOutllok.EditValue = SyncronizationOptionForm.AllowCreateAppointmentInOutlook;
checkEditAllowCreateScheduler.EditValue = SyncronizationOptionForm.AllowCreateAppointmentInScheduler;
winforms-popup-container-edit-with-default-ok-button/CS/MainForm.cs#L27
{
popupContainerEditOKButtonForTest.Properties.ShowOkButton = (bool)checkEditShowOk.EditValue;
Control currentPopupWindow = (popupContainerEditOKButtonForTest as IPopupControl).PopupWindow;
winforms-rich-text-editor-retain-original-image-uri-in-html-document/CS/Form1.cs#L20
richEditControl1.Document.Images.Insert(pos, DocumentImageSource.FromUri(imageUri, null));
embedImagesCheck.EditValue = true;
richEditControl1.ContentChanged += new EventHandler(richEditControl1_ContentChanged);
winforms-scheduler-sync-with-outlook/VB/SyncWithOutlook/SyncronizationOptionForm.vb#L31
Private Sub SyncronizationOptionForm_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
checkEditAllowCreateOutllok.EditValue = SyncronizationOptionForm.AllowCreateAppointmentInOutlook
checkEditAllowCreateScheduler.EditValue = SyncronizationOptionForm.AllowCreateAppointmentInScheduler
winforms-popup-container-edit-with-default-ok-button/VB/MainForm.vb#L21
Private Sub checkEditShowOk_Properties_EditValueChanged(ByVal sender As Object, ByVal e As EventArgs)
popupContainerEditOKButtonForTest.Properties.ShowOkButton = CBool(checkEditShowOk.EditValue)
Dim currentPopupWindow As Control = TryCast(popupContainerEditOKButtonForTest, IPopupControl).PopupWindow
winforms-rich-text-editor-retain-original-image-uri-in-html-document/VB/Form1.vb#L16
richEditControl1.Document.Images.Insert(pos, DocumentImageSource.FromUri(imageUri, Nothing))
embedImagesCheck.EditValue = True
AddHandler richEditControl1.ContentChanged, AddressOf richEditControl1_ContentChanged
See Also