DataGridView ComboBox lookup question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to do something that I would think would be easy.

I have a dataset that is filled from an XML file.

For simplicity, let's say there are two tables:

- Table Customer has fields CustomerID and CustomerName
- Table Orders has fields OrderNo, CustomerID, and ItemNo

My DataGridView shows all orders. What I want is the CustomerID column to
show the customer name and to list all customer names when the user clicks
the drop-down. Obviously, the associated customer ID should be stored in the
table.

I cannot seem to get this to work and am not having a lot of luck finding
help online. Can someone give some insight?

Thanks,
Chris
 
Chris,

That is were it made for.
The combobox has a datasource, a displaymember and a valuemember.
The first is the Table Customer, the second your Customer Name, the thirth
your CustomerID

Cor
 
Thanks. I knew it could be done but couldn't figure out my problem. My
problem was that I was referring to the wrong table when settings the
ValueMember. Thanks for your help.
 
Back
Top