Solved

Clearing the selection in a Winform Combobox of type: DropDownList

Posted on 2007-11-29
2
896 Views
Last Modified: 2008-09-12
Hi:

I'm using a Combobox in .Net 2.0 winforms. The DropdownStyle for the combobox is set to DropDownList. When the combobox first displays, the edit portion shows a blank (indetermanite state).
I would like to programmatically reset this property so it's back to the indetermanite state.

Is there any way to do this without adding a blank ("") entry to mycollection list?

Thanks,
JohnB
0
Comment
Question by:jxbma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 7

Expert Comment

by:prosh0t
ID: 20379977
It should just be like this: comboBox1.SelectedIndex = -1;
0
 
LVL 7

Accepted Solution

by:
prosh0t earned 125 total points
ID: 20379980
this also works:
comboBox1.SelectedItem = null;
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question