Custom dropdownlist that displays a listbox

P

Peter S.

This is driving me crazy, I am trying to build a custom dropdownlist that when
rendered also displays a listbox next to it. I am going to use the listbox as
a repository for items that are selected when accessing the dropdown. I did
override CreateControlCollection() and returned "new
ControlCollection(this);".
However when I add controls (by overriding CreateChildControls()) I do not see
them on the webpage. Is there any other magic that needs to be done? I have
created other custom controls without a problem. Any information would be
greatly
appreciated!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Thanks,
Peter
 
J

Jan Peter Stotz

Peter said:
This is driving me crazy, I am trying to build a custom dropdownlist that when
rendered also displays a listbox next to it.

Then it is not a custom DropdownList but a composite control. You should
probably better try to create a custom control that contains both the
dropdown- and the listbox.

Jan
 
P

Peter S.

I would like the base clase to be a dropdownlist so that I can invoke the
class in my webpage and dynamically set the list items. I could have multiple
dropdowns in my page and would like to set the items in my page rather
than programatically.

The question is,is this possible and if so what do I need to know to make it
work????

-Peter
 
J

Jan Peter Stotz

Peter said:
I would like the base clase to be a dropdownlist so that I can invoke the
class in my webpage and dynamically set the list items.

I don't see any problem to create a composite control that implements the
same interface as the DropdownList class or do you need polymorph
inheritance?

Jan
 
P

Peter S.

I *have* created a composite control that implements the DropDownList.
The problem is when I try to display a listbox beside it by overriding
the CreateChildControls() method. Is that possible????
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top