How do i bind a NVL to a LookupEdit Control (DevExpress)?
On my InvoiceEdit form i have this:
Public Sub New(ByVal NewInvoice As Invoice)
InitializeComponent()
mInvoice = NewInvoice
LookUpEdit1.DataBindings.Add("EditValue", mInvoice, "EmployeeID")
LookUpEdit1.Properties.DataSource = EmployeeList.GetEmployeeList
Me.LookUpEdit1.Properties.DisplayMember = "Name"
Me.LookUpEdit1.Properties.ValueMember = "Id"
ApplyAuthorizationRules()
End Sub
but when i check the value of my mInvoice.EmployeeID prop on the event of the LookupEdit editvaluechanged the mInvoice.employeeID still = 0, am i overlooking something?
Thanks in Advance!
Two suggestions.
1). Change the line LookUpEdit1.DataBindings.Add("EditValue", mInvoice, "EmployeeID") to be
LookUpEdit1.DataBindings.Add("EditValue", mInvoice, "EmployeeID", false, DataSourceUpdateMode.OnPropertyChanged)
Might not make a difference, but that is how I use it.
2) Check that the datatype of EmployeeID in mInvoice is exactly the same as the datatype of Id in your EmployeeList object. If they are even slightly different e.g. int and short it will not work.
Other than that can't see anything wrong. I use LookUpEdits with NVLs all the time.
HTH
Allright Guys! i got it working using the following code:
'Fill the lookupEdit Control - Employee
LookUpEdit1.Properties.DataSource = EmployeeList.GetEmployeeList
LookUpEdit1.EditValue = "0"
Me.LookUpEdit1.Properties.DisplayMember = "Name"
Me.LookUpEdit1.Properties.ValueMember = "Id"
'Bind Course.EmployeeID to LookupEdit control - Employee List
LookUpEdit1.DataBindings.Add("EditValue", mInvoice, "EmployeeID", False, DataSourceUpdateMode.OnPropertyChanged)
Also in the control props i didn't set any properties (if anyone its wondering about that) and this code its located on the Public Sub New of the FormEdit.
Thanks for the Help!
Copyright (c) Marimer LLC