Microsoft
Software
Hardware
Network
Question : Combobox values default
Hi Am developing windows application where in am loading the combo box as follows
cmbtitleid.BindingContext = new BindingContext();
cmbtitleid.DataSource = datasourcetitle;
cmbtitleid.ValueMember = "TITLEID";
cmbtitleid.DisplayMember = "DECRIPTION";
cmbtitleid.SelectedIndex = -1;
Here, what I want to do is, the datasource has only 1 record, then it should be displayed in combobox by default. If there are more than 1 record, then cmbtitleid.SelectedIndex = -1;
should work as is. How do i alter this code to achive what i want
Answer : Combobox values default
almost forgot: if there's a possibility that there's no data returned, do
else if(cmbtitleid.Items.Count == 1)
instead of the else-statement.
Random Solutions
Win 7 file sharing
3 Monitors: 2 VGA, 1 DVI
how to add 2 minutes to timestamp in Oracle
which is faster of the two...
Transaction problem
SBS 2003 R2 remote web workplace
I am trying to compile an already produced program and it gets error 9009, which I was told has to do with the path of the batch program, where do I re-path the batch program correctly?
Active Directory Help
Migrate a Cisco Router-On-A-Stick type of network
What is the impact of recreating an OU certifier on current users?