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
Diviner Chan
NA
7
0
Binding Lookup-ComboBox
Aug 8 2008 5:47 AM
Hi all,
I want to use a ComboBox to let user to fill a lookup field, but no idea how to do that.
I have two tables, PO and Buyer. In PO table, it has a field buyer_id to specify which the buyer involves this PO. Now in PO maintenance form it has a ComboBox "cbBuyer" which is for accessing buyer_id of PO table.
Buyer:
- id field
- name field
PO table:
- id field
- buyer_id field
class PO_Form
{
...
cbBuyer.DisplayMember = "name";
cbBuyer.ValueMember = "id";
cbBuyer.DataSource = BuyerDAO.QueryAll().ToArray();
cbBuyer.DataBindings.Add("Text", po, "buyer_id"); // This code has bug !!!
...
}
When I run the application, cbBuyer ComboBox drop down item has all Buyers name properly, but when user select one of the ComboBox item and leave the ComboBox, the value is disappeared.
How can I bind it up properly?
Thank you very much.
Best regards,
Diviner.
Reply
Answers (
1
)
Linq 'where' and 'and' not working??
Execution plan saved for LINQ compiled queries?