hi,
im designing a form that updates a customer details. when the user enter an id, the form displays all the fields of that customer. my problem is that i have a combobox that displays the status of the customer, i filled the combobox with four items and when the user choose a customer, it displayed the correct value from the combobox. but when the user doesn't choose a value from the combobox, the comboxbox gets null instead of the value it was assign with. i want that if the user doesnt change the value in the combobox, the combobox will automatically gets the value it was assign with.
c#Programmer 0 Newbie Poster
Recommended Answers
Jump to PostDid you set the DropDownStyle property correctly? http://msdn.microsoft.com/en-us/library/system.windows.forms.comboboxstyle(v=VS.90).aspx
Jump to Postjust after you populate the comboBox, call this property:
comboBox1.SelectedIndex = -1;
This way the by default will nothing be selected.
But this will only work if you populate comboBox manually; that means that the comboBox is not data bound.I didnt really get you what …
All 8 Replies
ChrisHunter 152 Posting Whiz in Training Featured Poster
c#Programmer 0 Newbie Poster
c#Programmer 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
c#Programmer 0 Newbie Poster
Mitja Bonca 557 Nearly a Posting Maven
c#Programmer 0 Newbie Poster
Mitja Bonca 557 Nearly a Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.