TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Peter Dzuya
NA
313
40.7k
Display member and value member SeachLookupEdit Combo
Jun 14 2016 8:55 AM
Hi All,
I have a SeachLookupEdit Combo which I use to fetch data from my Datasource as follows.
public partial class frmGatePass : DevExpress.XtraEditors.XtraForm{
private ISupplierService _supplierService;
private readonly Supplier _supplier;
private void frmGatePass_Load(object sender, EventArgs e){
supplierBindingSource.DataSource = _supplierService.GetAll();
}
private void contactNameSearchLookUpEdit_EditValueChanged(object sender, EventArgs e) {
try {
var selectedSupplier = contactNameSearchLookUpEditView.GetFocusedRow() as Supplier;
if (selectedSupplier == null)return;
_supplier = _supplierService.GetById(selectedSupplier.ContactId);
_supplier.ContactId = selectedSupplier.ContactId;
selectedSupplierContactRelationId = selectedSupplier.ContactRelationId;
telephoneTextEditScreen.Text = selectedSupplier.Contact.Telephone;
} catch (Exception Errhandler) {
MessageBox.Show(Errhandler.Message);
}
}
}
And My Data Binding is as follows:-
DataSource = supplierBindingSource,
Display Member = Contact.ContactName,
Value Member = ContactId.
My Problem once I click an item on the drop down list, first it picks the right item, but if I felt I made a wrong choice and click to select another item, I get the Primary Key Id within the List in the first row. How do I sort This kind of an issue.
Thanks
Reply
Answers (
2
)
show image of minimized form when mousehover event occured
Fire Timers Tick Event simultaneously c# windows application