dropdownlist on web form

SteveInBeloit

Well-known member
Joined
May 22, 2006
Messages
132
Programming Experience
10+
Hi,
I have just developed my first ASP .NET webform. A re-write of a VB .NET windows application. Everything is good except the behavior of the combo boxes. They are loaded from stored procedures in SQL 2005. That part is good, the have the good data.
But I do not want them all set to the first item in the list. When the user first pushes a button and the dropdownlists become visable, I want them to be blank. I don't really want to alter each stored proc to return a blank row and try to sort that one to the top.

How is this done?
 
Hey all,
Here I what I have learned that seems to work. I didn't want to have to dummy up the stored proc to return a <Choose Selection> row. This way I didn't.

You can add additional items directly to the dropdownlist. Click on the tasks arrow on the dropdownlist and then "Edit items." Then set the dropdownlist's "AppendDataBoundItems" property to True. This will append whatever items you add to the data retrieved from your stored procedure. So when I added "Choose Selection", all my entries from the stored proc appended to that.

Next question, I have one dropdownlist that if the users do not see the one that applies to them, I want them to be able to enter their own. But the dropdownlist doesn't allow that. How can this be done?

Thanks
Steve
 
This is the easiest way to add to a dropdownlist:
ddl.Items.Insert(0, "--Please Select--")

Second question:
Use a textbox so they can enter the info.
 
Back
Top