Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   Creating a panel with a collection property -- NEED HELP (http://www.velocityreviews.com/forums/t775415-creating-a-panel-with-a-collection-property-need-help.html)

Nicolas LeBlanc 02-15-2005 08:36 PM

Creating a panel with a collection property -- NEED HELP
 
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.

Wilco Bauwer 02-16-2005 07:59 AM

Re: Creating a panel with a collection property -- NEED HELP
 
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 02-16-2005 04:48 PM

Re: Creating a panel with a collection property -- NEED HELP
 
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" <wilcob@gmail.com> a écrit dans le message de
news:1108540767.370392.71700@l41g2000cwc.googlegro 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.
>





All times are GMT. The time now is 10:20 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.