Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ToggleSwitch.EditValue Property

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

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.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