Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Creating a panel with a collection property -- NEED HELP

Reply
Thread Tools

Creating a panel with a collection property -- NEED HELP

 
 
Nicolas LeBlanc
Guest
Posts: n/a
 
      02-15-2005
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 ****ed 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.
 
Reply With Quote
 
 
 
 
Wilco Bauwer
Guest
Posts: n/a
 
      02-16-2005
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.

 
Reply With Quote
 
 
 
 
Nicolas LeBlanc
Guest
Posts: n/a
 
      02-16-2005
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" <(E-Mail Removed)> a écrit dans le message de
news:(E-Mail Removed) ups.com...
> 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.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Collection problems (create Collection object, add data to collection, bind collection to datagrid) Řyvind Isaksen ASP .Net 1 05-18-2007 09:24 AM
Binding to property of property of object collection TS ASP .Net 3 08-31-2006 12:57 PM
WebControl - CollectionEditor Problem. Changing id property of new added collection item causes not adding item to collection - Sergio ASP .Net Web Controls 0 05-29-2006 06:20 AM
Creating a panel with a collection property -- NEED HELP Nicolas LeBlanc ASP .Net Building Controls 2 02-16-2005 04:48 PM
Email From Forms with asp:panel.(s) Only one panel works? Harry ASP .Net 3 11-10-2003 03:13 AM



Advertisments