Home All Groups Group Topic Archive Search About

Custom dropdownlist that displays a listbox

Author
21 Nov 2005 1:46 PM
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

Author
21 Nov 2005 2:04 PM
Jan Peter Stotz
Peter S. schrieb:

> 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
Author
21 Nov 2005 2:39 PM
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

Show quoteHide quote
"Jan Peter Stotz" wrote:

> Peter S. schrieb:
>
> > 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
>
Author
21 Nov 2005 3:44 PM
Jan Peter Stotz
Peter S. schrieb:

> 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
Author
21 Nov 2005 6:36 PM
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????

Show quoteHide quote
"Jan Peter Stotz" wrote:

> Peter S. schrieb:
>
> > 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
>