Custom dropdownlist that displays a listbox

Discussion in 'ASP .Net Web Controls' started by Peter S., Nov 21, 2005.

  1. Peter S.

    Peter S. Guest

    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
    Peter S., Nov 21, 2005
    #1
    1. Advertising

  2. 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
    Jan Peter Stotz, Nov 21, 2005
    #2
    1. Advertising

  3. Peter S.

    Peter S. Guest

    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

    "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
    >
    Peter S., Nov 21, 2005
    #3
  4. 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
    Jan Peter Stotz, Nov 21, 2005
    #4
  5. Peter S.

    Peter S. Guest

    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????

    "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
    >
    Peter S., Nov 21, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. blenderdude
    Replies:
    0
    Views:
    970
    blenderdude
    Aug 3, 2003
  2. DC Gringo
    Replies:
    0
    Views:
    398
    DC Gringo
    Apr 6, 2004
  3. Chumley Walrus
    Replies:
    1
    Views:
    12,175
    =?Utf-8?B?QnJpYW4gQnJvd24=?=
    Dec 16, 2004
  4. Peter S.

    Composite dropdownlist control that also displays a listbox????

    Peter S., Nov 21, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    159
    Peter S.
    Nov 21, 2005
  5. DOK
    Replies:
    1
    Views:
    204
    Henrik Stidsen
    Mar 6, 2007
Loading...

Share This Page