Click here to Skip to main content
15,891,902 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a table in sqlServer like this:

ID Title
-----------
1 Director
3 Actor
5 Producer

The above data is populated in a combobox.

C#
this.cmb1.DisplayMember = "Title";
               this.cmb1.ValueMember = "ID";


I what to select combobox using ID value
Posted

1 solution

You need to set the selected value:
this.cmb1.SelectedValue=3;
 
Share this answer
 
Comments
Shanalal Kasim 14-Jun-14 11:44am    
I want to select ID =5
ziad imad 23-Jun-14 17:24pm    
this.cmb1.SelectedValue=5;

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