Hi friends,
Please update me that,
How to add empty list in dropdownlist in C#.NET, when I fill that combo from data reader.
Thanks,
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
MuthuMari MRank #5,738 · 288 reputationPosted Apr 4, 2012, 2:16 AM EDT
asp:DropDownList ID="Whatever" runat="server" AppendDataBoundItems="True"> asp:ListItem Value="" Text="Select one..." /> asp:DropDownList>the use of
AppendDataBoundItems="True"And then when you bind, the bound items are put after the empty item rather than replacing it.
Pls refer this url
http://stackoverflow.com/questions/679128/add-empty-item-to-dropdownlist-of-custom-objects-in-c-sharp
Thanks!
SenthilkumarRank #387 · 6.5K reputationPosted Apr 4, 2012, 2:59 AM EDT
Place the drop down control in your design page.
You no need to add any thing. But if you want to add the default text then
When click on some thing or based on the other event, if you want to load the data into the drop down list then
Hope this help you.
Manikandan Chandran34 reputationPosted Apr 4, 2012, 6:25 AM EDT