Click here to Skip to main content
15,889,992 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to add a default value to my custom drop down list, but this value should NOT appear in my list.It should only appear in that control when i dont select anything.
Posted
Comments
Sandeep Mewara 11-Jun-12 10:19am    
Ok. And whatever you want, did you try? What issue did you face?
sapna62 12-Jun-12 0:21am    
I have tried but the default value "Select Item" appears in the list when i click on that arrow.that i dont want.

1 solution

why don't you add an empty listitem to the ddl selected by default


C#
ddl.Items.Insert(0, "");
ddl.ClearSelection();
ddl.SelectedIndex = 0;


sounds weird a dropdown with no selection.

i know that it does appear in the ddl.
but that seems more "standard"
 
Share this answer
 
v2
Comments
sapna62 12-Jun-12 0:22am    
I mentioned that i do not want that item to appear in my list.even if it is blank.

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