Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / July 2006

Tip: Looking for answers? Try searching our database.

How to create server control of Container Type

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hungrymind@gmail.com - 20 Jul 2006 12:13 GMT
Hi All,

I am trying to build one server control which has one panel and within
this panel there will be two more panel. I have created two instance of
MyPanel class (inherited by Panel), it works fine in design as well as
runtime. The problem is I want user to be able to add controls on
designtime to the inner panel. Can any body tell me how to achieve
this? I tried inheriting MyPanel class with IContainer, still its not
working. When I inherit the main control with Panel, I am able to add
controls in design time while same I am doing for Inner Panel, its not
working. Also I have tried adding InnerPanel (MyPanel) in Render, Init
method, Constructor of controls, but neither way it worked. Can any
body suggest where I am doing wrong.

wishing you all in anticipation,

warm regards,
- hungrymind
Gary Vidal - 26 Jul 2006 01:49 GMT
Use ITemplate and in the CreateChildControls

///Property
public ITemplate PanelTemplate
{
   get{return m_PanelTemplate;}
   set{m_PanelTemplate = value;}
}

///createchildcotnrols

m_PanelTemplate.InstantiateIn(panelToInstantiate);
//add any additional controls to the template

Gary Vidal
> Hi All,
>
[quoted text clipped - 14 lines]
> warm regards,
> - hungrymind

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.