Back to Devexpress

ComboBoxEdit.EditValue Property

windowsforms-devexpress-dot-xtraeditors-dot-comboboxedit-3be2f376.md

latest7.6 KB
Original Source

ComboBoxEdit.EditValue Property

Allows you to select an item with the specific value, or to read the currently selected item’s value. You can also use the ComboBoxEdit.SelectedItem property to do the same. Additionally, EditValue allows you to specify a custom editor value.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Data")]
public override object EditValue { get; set; }
vb
<DXCategory("Data")>
Public Overrides Property EditValue As Object

Property Value

TypeDescription
Object

The edit value.

|

Remarks

The code sample below illustrates how to select a “Default” item in an in-place ComboBox editor when a user activates a cell.

csharp
private void gridView1_ShownEditor(object sender, EventArgs e)
{
    GridView currentView = sender as GridView;
    ComboBoxEdit cmbPO = currentView.ActiveEditor as ComboBoxEdit;
    cmbPO.EditValue = "Default";
}
vb
Private Sub gridView1_ShownEditor(ByVal sender As Object, ByVal e As EventArgs)
    Dim currentView As GridView = TryCast(sender, GridView)
    Dim cmbPO As ComboBoxEdit = TryCast(currentView.ActiveEditor, ComboBoxEdit)
    cmbPO.EditValue = "Default"
End Sub

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.

reporting-winforms-label-report-in-code/CS/Reporting_how-to-create-a-label-report-at-runtime-t473792/Form1.cs#L29

csharp
Convert.ToSingle(HorizontalPitchSpinEdit.EditValue),
(DXGraphicsUnit)UnitComboBox.EditValue,
Convert.ToSingle(BottomMarginSpinEdit.EditValue),

winforms-scheduler-sync-with-outlook/CS/SyncWithOutlook/Form1.cs#L43

csharp
private void btnSchedulerOutlook_Click(object sender, EventArgs e) {
    if(comboBoxEdit1.EditValue != null)
    {

how-to-keep-a-look-and-feel-of-windows-forms-in-sync-e2243/CS/ThreadedSkinning/Form1.cs#L18

csharp
comboBoxEdit1.EditValue = DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName;
foreach(DevExpress.Skins.SkinContainer cnt in DevExpress.Skins.SkinManager.Default.Skins) {

winforms-workspacemanager-saving-load-app-layout/CS/T190543/Form1.cs#L60

csharp
if (edit != null) {
    TransitionType value = (TransitionType)edit.EditValue;
    BaseTransition transition = null;

winforms-scheduler-sync-outlook-calendars/CS/SyncWithOutlook/Form1.cs#L36

csharp
private void btnSchedulerOutlook_Click(object sender, EventArgs e) {
    if(comboBoxEdit1.EditValue != null) {
        synchronizerHelper.CalendarFolder = comboBoxEdit1.EditValue.ToString();

reporting-winforms-label-report-in-code/VB/Reporting_how-to-create-a-label-report-at-runtime-t473792/Form1.vb#L26

vb
Dim builder As New CustomLabelReportBuilder()
Dim labelReport As XtraReport = builder.GenerateLabelReport(Convert.ToSingle(LabelWidthSpinEdit.EditValue), Convert.ToSingle(LabelHeightSpinEdit.EditValue), Convert.ToSingle(VerticalPitchSpinEdit.EditValue), Convert.ToSingle(HorizontalPitchSpinEdit.EditValue), DirectCast(UnitComboBox.EditValue, DevExpress.Drawing.DXGraphicsUnit), Convert.ToSingle(BottomMarginSpinEdit.EditValue), Convert.ToSingle(TopMarginSpinEdit.EditValue), Convert.ToSingle(LeftMarginSpinEdit.EditValue), Convert.ToSingle(RightMarginSpinEdit.EditValue), Convert.ToInt32(lookUpPaperType.EditValue))
Return labelReport

winforms-scheduler-sync-with-outlook/VB/SyncWithOutlook/Form1.vb#L45

vb
Private Sub btnSchedulerOutlook_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSchedulerOutlook.Click
            If comboBoxEdit1.EditValue IsNot Nothing Then
' #Region "#scheduler->outlook"

how-to-keep-a-look-and-feel-of-windows-forms-in-sync-e2243/VB/ThreadedSkinning/Form1.vb#L15

vb
InitializeComponent()
comboBoxEdit1.EditValue = UserLookAndFeel.Default.SkinName
For Each cnt As DevExpress.Skins.SkinContainer In DevExpress.Skins.SkinManager.Default.Skins

winforms-workspacemanager-saving-load-app-layout/VB/T190543/Form1.vb#L57

vb
If edit IsNot Nothing Then
    Dim value As TransitionType = CType(edit.EditValue, TransitionType)
    Dim transition As BaseTransition = Nothing

winforms-scheduler-sync-outlook-calendars/VB/SyncWithOutlook/Form1.vb#L38

vb
Private Sub btnSchedulerOutlook_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSynchronization.Click
    If comboBoxEdit1.EditValue IsNot Nothing Then
        synchronizerHelper.CalendarFolder = comboBoxEdit1.EditValue.ToString()

See Also

SelectedItem

SelectedIndex

Text

ComboBoxEdit Class

ComboBoxEdit Members

DevExpress.XtraEditors Namespace