Creating a panel with a collection property -- NEED HELP

Discussion in 'ASP .Net Web Controls' started by Nicolas LeBlanc, Feb 15, 2005.

  1. Hello everybody,

    I've been working lately on making my own tabstrip control because I couldn't find anything that works the way I want it. But now I have a problem, because I have a "Tabs" property which is the collection of tabs inside my control, I'm no longer able to add controls inside the panel...

    So basically I have

    <cc1:TabStrip properties>
    <Tabs>
    <Tab1 properties></Tab1>
    ...
    </Tabs>
    </cc1:TabStrip>

    But with a normal panel, you can add whatever you want inside the panel (controls, etc)... but now I can't, if I try to add <asp:LinkButton id=...></asp:LinkButton> it will tell me that there are no property called "asp:LinkButton"...

    Now I'm seriously pissed because it's thing left to finish my control, I want to add WebUserControl inside the pannel and make them visible or not when a tab is clicked.

    The reason why I simply don't use another panel and work on it directly on the page is because I'm not using a plain panel, I'm using one of my owned which is boxed.. so you have the tabs, the box and controls will show up in the box...

    But that doesn't work because of the properties.

    Any help is appreciated.
     
    Nicolas LeBlanc, Feb 15, 2005
    #1
    1. Advertising

  2. Nicolas LeBlanc

    Wilco Bauwer Guest

    If you really want to be able to add any kind of control to the Tabs
    property, then you could change the Tabs' type to ControlCollection.
    This means that you will have to create a Tab control which represents
    a tab inside the tabstrip.

    Then again, I think it would probably be nicer to change the type of
    Tabs to TabControlCollection, a custom collection which derives from
    ControlCollection and only takes Tab controls. You could then only add
    controls which are a Tab. To be able to add custom controls, you could
    for example create a custom Tab implementation which wouldn't render
    anything, except its children.
     
    Wilco Bauwer, Feb 16, 2005
    #2
    1. Advertising

  3. Well, I just found a way to trick this.

    I declared a PlaceHolder property in my control, and I can put whatver I
    want in it.

    <Holder>
    .... controls
    </Holder>

    Works like a charm!

    "Wilco Bauwer" <> a écrit dans le message de
    news:...
    > If you really want to be able to add any kind of control to the Tabs
    > property, then you could change the Tabs' type to ControlCollection.
    > This means that you will have to create a Tab control which represents
    > a tab inside the tabstrip.
    >
    > Then again, I think it would probably be nicer to change the type of
    > Tabs to TabControlCollection, a custom collection which derives from
    > ControlCollection and only takes Tab controls. You could then only add
    > controls which are a Tab. To be able to add custom controls, you could
    > for example create a custom Tab implementation which wouldn't render
    > anything, except its children.
    >
     
    Nicolas LeBlanc, Feb 16, 2005
    #3
    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. Harry
    Replies:
    3
    Views:
    568
    Harry Singh
    Nov 10, 2003
  2. HS1
    Replies:
    3
    Views:
    514
  3. TS
    Replies:
    3
    Views:
    2,505
  4. Øyvind Isaksen
    Replies:
    1
    Views:
    1,021
    Øyvind Isaksen
    May 18, 2007
  5. Nicolas LeBlanc

    Creating a panel with a collection property -- NEED HELP

    Nicolas LeBlanc, Feb 15, 2005, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    125
    Nicolas LeBlanc
    Feb 16, 2005
Loading...

Share This Page