Skip to main content

ToggleSwitch.EditValue Property

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

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

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;
See Also