Click here to Skip to main content
15,923,168 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I am using datagridview, in datagridview I have a combobox column for product name. I have A datatable containing productname and productid.
I am trying to attach this datatable to combobox column as datasource with productname as display member and productid as valuemember also
I am trying to type in combobox and when I type I try to display a list according to alphabet typed.
How to do this?

Please help
Posted
Updated 19-Jan-11 23:49pm
v2

Hello Yatin,

i Can't understood your problem completely,
but just try this

Set ComboBox Properties as

ComboBox.DropdownStyle = DropDownList;
ComboBox.Sorted = true
;
 
Share this answer
 
Hi Yatin,

Try this link :
http://homepage.ntlworld.com/herring1/datagrid.html[^]

Hope to be helpful
:)
 
Share this answer
 
v3
please note that datatable, productid and productname are only represnetations and they need to be meanigful code in your part.

ComboBox.DataSource = datatable 
ComboBox.DataValueField = productid 
ComboBox.DataTextField = productname 



See ComboBox Documentation http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900