windowsforms-devexpress-dot-xtraeditors-dot-baseedit.md
Gets or sets the editor’s value.
Namespace : DevExpress.XtraEditors
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[Bindable(true)]
[DefaultValue(null)]
[DXCategory("Data")]
public virtual object EditValue { get; set; }
<Bindable(True)>
<DXCategory("Data")>
<DefaultValue(Nothing)>
Public Overridable Property EditValue As Object
| Type | Default | Description |
|---|---|---|
| Object | null |
An object representing the editor’s value.
|
Setting this property to a new value raises the RepositoryItem.EditValueChanging event. The RepositoryItem.EditValueChanged event fires after the EditValue property value has been changed.
Use the BaseEdit.Text property to obtain the editor’s text representation of this value.
The following example binds a CalcEdit editor to the Freight field in a data source (OrdersBindingSource).
calcEdit1.DataBindings.Add(new System.Windows.Forms.Binding("EditValue", ordersBindingSource, "Freight", true));
CalcEdit1.DataBindings.Add(New System.Windows.Forms.Binding("EditValue", OrdersBindingSource, "Freight", True))
The following example uses the EditValue property to select the first lookup row in a LookUpEdit control.
private void btnSelectRow_Click(object sender, EventArgs e) {
lookUpEdit1.EditValue = lookUpEdit1.Properties.GetDataSourceValue(lookUpEdit1.Properties.KeyMember, 0);
}
Private Sub btnSelectRow_Click(sender As Object, e As EventArgs) Handles btnSelectRow.Click
lookUpEdit1.EditValue = lookUpEdit1.Properties.GetDataSourceValue(lookUpEdit1.Properties.KeyMember, 0)
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.
winforms-mvvm-best-practices/CS/POCOBindableProperties/DataBindingViaMVVMContextUserControl.cs#L34
// Data binding for the Title property (via MVVMContext API)
mvvmContext.SetBinding(editor, e => e.EditValue, "Title");
// UI binding for the Report command
Convert.ToSingle(RightMarginSpinEdit.EditValue),
Convert.ToInt32(lookUpPaperType.EditValue)
);
else
timeEnd.EditValue = new DateTime(controller.DisplayEnd.TimeOfDay.Ticks);
;
how-to-use-the-processnewvalue-event-of-a-lookup-editor-e285/CS/Form2.cs#L12
public object ItemID {
get { return TextEdit1.EditValue; }
set { TextEdit1.EditValue = value; }
if (edit == null || !edit.Visible) return;
if (edit.IsModified && edit.EditValue != null && updateValues)
SetChildRowValues(edit);
winforms-mvvm-best-practices/VB/POCOBindableProperties/DataBindingViaMVVMContextUserControl.vb#L32
' Data binding for the Title property (via MVVMContext API)
mvvmContext.SetBinding(editor, Function(e) e.EditValue, "Title")
' UI binding for the Report command
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-print-appointments-using-reports/VB/PrintingViaReports/Form1.vb#L147
cbView.EditValue = schedulerControl1.ActiveViewType
rgrpGrouping.EditValue = schedulerControl1.GroupType
End Sub
how-to-use-the-processnewvalue-event-of-a-lookup-editor-e285/VB/Form2.vb#L13
Get
Return TextEdit1.EditValue
End Get
End If
If edit.IsModified AndAlso edit.EditValue IsNot Nothing AndAlso updateValues Then
SetChildRowValues(edit)
See Also