ndornack
asked on
c# winform combo box does not display database value
I have a 2 combo boxes on my form.
cboCurPartNum
Data Source - curpartBindingSource
Display Member - PartNum
Value Member - Part Num
Selected Value - engordbindingsource - curpartnum
cboPrePartNum
Data Source - prepartBindingSource
Display Member - PartNum
Value Member - Part Num
Selected Value - engordbindingsource - prepartnum
When the form is loaded a object "engord" contains all the data for the selected engineering order and this gets binded to "engordbindingsource". the fields engord.curpartnum and engord.prepartnum populate
cbocurpartnum and cboprepartnum, respectively.
for some reason only the cbocurpartnum is working.
cboprepartnum does not work - it will not select the value from engordbindingsource - prepartnum
What am I missing?
cboCurPartNum
Data Source - curpartBindingSource
Display Member - PartNum
Value Member - Part Num
Selected Value - engordbindingsource - curpartnum
cboPrePartNum
Data Source - prepartBindingSource
Display Member - PartNum
Value Member - Part Num
Selected Value - engordbindingsource - prepartnum
When the form is loaded a object "engord" contains all the data for the selected engineering order and this gets binded to "engordbindingsource". the fields engord.curpartnum and engord.prepartnum populate
cbocurpartnum and cboprepartnum, respectively.
for some reason only the cbocurpartnum is working.
cboprepartnum does not work - it will not select the value from engordbindingsource - prepartnum
What am I missing?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes, prepartBindingSource is filled with values. If I set the SelectedText property, the value from engordBindingSource.prepar tnum is displayed. However, when you select the dropdown and value is not selected on in the list, which is coming from prepartBindingSource.
ASKER
I had to trim the data before assigning to the combo box. Now its working. Thanks for your comment.
ASKER