PC Review


Reply
Thread Tools Rate Thread

DataGridView ComboBox lookup question

 
 
=?Utf-8?B?Q2hyaXMgSGxhZGU=?=
Guest
Posts: n/a
 
      12th Jan 2007
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
 
Reply With Quote
 
 
 
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      13th Jan 2007
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

"Chris Hlade" <(E-Mail Removed)> schreef in bericht
news:74008A3E-7AB3-4A48-9951-(E-Mail Removed)...
>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



 
Reply With Quote
 
=?Utf-8?B?Q2hyaXMgSGxhZGU=?=
Guest
Posts: n/a
 
      14th Jan 2007
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.

"Cor Ligthert [MVP]" wrote:

> 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
>
> "Chris Hlade" <(E-Mail Removed)> schreef in bericht
> news:74008A3E-7AB3-4A48-9951-(E-Mail Removed)...
> >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

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Desperate Lookup Combobox or binding combobox sennopati Microsoft VB .NET 0 9th Feb 2008 11:09 AM
Newbie question about combobox/adding row to lookup table =?Utf-8?B?RU1hbm5pbmc=?= Microsoft VB .NET 2 19th Nov 2007 07:34 PM
DataGridView - Add a "ComboBox Lookup Table" ESmith Microsoft Dot NET Framework Forms 0 24th May 2006 07:58 PM
DataGridView and ComboBox =?Utf-8?B?QXJ0?= Microsoft VB .NET 3 13th May 2006 03:43 AM
combobox lookup question Annelie Microsoft Access Forms 4 29th Dec 2003 04:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:46 AM.