Add ListItem to Custom DropDownList
ASP.NET
3
Posts
2
Posters
0
Views
1
Watching
-
I created a custom dropdownlist. (inherit from standard dropdownlist control) I want to add ListItem inside this control. but I don't know where I must add ListItem. I add it in RenderContent method but I received NullRefrenceException .
-
I created a custom dropdownlist. (inherit from standard dropdownlist control) I want to add ListItem inside this control. but I don't know where I must add ListItem. I add it in RenderContent method but I received NullRefrenceException .
-
DropDownList1.Items.Add(new ListItem("ItemString", "ItemValue"));
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.
I konw that! but I want create custom dropdownlist with 3 default items