Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,


i using comboboxes in WPF with c#, i m trying to update list dynamically through code from database, i m trying to use the text property , for writing text "Select any option" which is not working, how to show "Select any option " on the top of the combo box.


thnx in advance
Posted
Comments
Prabhakaran Soundarapandian 28-Aug-12 4:57am    
Show the code what you have tried....

1 solution

Assuming you are binding text to the dropdown, just add an additional row to the collection before the binding.
For example, "--Select an option--".

This will automatically appear on the top of the dropdown.
 
Share this answer
 
Comments
Tasawer Nawaz 2-Sep-12 8:42am    
actually problem is this, that i dont want to add an additional item in collection of dropdown, because if user dos not choose any aoption then what wikk be selected value.. ????
Abhinav S 2-Sep-12 23:23pm    
It will be -1.

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