Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two combobox one is product Id and another one is product name. For the both combobox I am assigning same DataTable as datasourse.

My combobox proprieties are follows

cmbprID.DataSource = prdList;
cmbprID.DisplayMember = "PRD_ID";
cmbprID.ValueMember = "PRD_ID";

cmbprName.DataSource = prdList;
cmbprName.DisplayMember = "PRD_NAME";
cmbprName.ValueMember = "PRD_NAME";

and AutoComplete mode=None

Shorted=false

And now when I run the program all the data loading properly. When I tried to type it is shorting the data but some times some of the data not bring to front. But that data available in drop down.

Following steps I took to solve

Shorted=true;

For this every thing is working fine. But the problem is, it is not picking product name with respect to PID which I select. The reason is the combobox sorting the data so the index value getting change.

ORDER BY PRODUCT_ID ASC in my SQL query.

Even this also not working. But it accuracy is better initial stage.

Please help me to get of of it
Posted

1 solution

Check This Link I hope It will Help You....
A C# auto complete combo box[^]

You Can Also so do like this..

C#
 ComboBox1.AutoCompleteMode = AutoCompleteMode.Suggest;
ComboBox1.AutoCompleteSource = AutoCompleteSource.CustomeSource;
 
Share this answer
 
v3

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