Skip to main content
A newer version of this page is available. .

ToggleSwitch.EditValue Property

Gets or sets the editor’s edit value, which specifies the editor’s check state.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v19.2.dll

Declaration

[Browsable(false)]
[DefaultValue(false)]
public override object EditValue { get; set; }

Property Value

Type Default Description
Object **false**

The editor’s edit value.

Remarks

To get or set the editor’s check state as a Boolean value, use the ToggleSwitch.IsOn property. The EditValue property, which is in sync with the ToggleSwitch.IsOn property, returns the editor’s check state as a value of the Object type.

The code sample below illustrates how to check the control’s EditValue.

if (toggleSwitch1.EditValue.ToString() == "True" && XtraMessageBox.Show("Are you sure you want to enable this functionality?", "Warning:", MessageBoxButtons.YesNo) == DialogResult.Yes)
    // Implement the needed functionality
else
    toggleSwitch1.IsOn = false;

The following code snippet (auto-collected from DevExpress Examples) contains a reference 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.

See Also