markiz
markiz

Reputation: 2184

Extending ASP.NET DropDownList

I am trying to create a custom control that inherits from DropDownList.

What I need is to add a new property to a ListItem(within Item collection).

<cc1:MyDropDownList ID="MyDropDownList1" runat="server">   
   <asp:ListItem myProperty="true" text="sometext" ... />                     

</cc1: MyDropDownList>    

How can I do that?

Upvotes: 2

Views: 2767

Answers (2)

David Robbins
David Robbins

Reputation: 10046

Can you extend the capabilities client-side with jQuery?

Upvotes: 0

user434917
user434917

Reputation:

Even if you inherit from the DropDownList you cannot add this property because you have to add it to the ListItem control.
But the problem is that ListItem class is sealed so you cannot inherit from it.

Upvotes: 3

Related Questions