ComboBox databinding

K

kitemad69

I have a combobox and i have a datatable with 2 columns in it
(description and code) . Now how can i display the description but use
the code as the value member.
 
K

kitemad69

I have a combobox and i have a datatable with 2 columns in it
(description and code) . Now how can i display the description but use
the code as the value member.

And when i display the value member it just says code;
 
N

Nicholas Paldino [.NET/C# MVP]

kitemad69,

You basically want to set the DisplayMember and ValueMember properties
to the name of the columns which contain the display member (description)
and value member (code).


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

I have a combobox and i have a datatable with 2 columns in it
(description and code) . Now how can i display the description but use
the code as the value member.

And when i display the value member it just says code;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top