simple way to create a custom control (like Panel) that you can drag and drop other controls into at design time

Hi ,

I need to create one custom control like panel, for containing some other controls into at design time. I tried with panel custom control but I am not able to add other server controls to that custom panel control at design time. Could anyone please help me out.



4/29/2008 9:28:11 AM 3498 articles. 0 followers. Follow

4 Replies

Similar Articles

[PageSpeed] 14


You need to override CreateChildControls function.

Inside the function something like this:

TextBox T = new TextBox();



Wamba {WamBlog}
Dont forget to click "Mark as Answer" on the post that helped you.
This credits the member,earns you a point & marks your thread as Resolved.
4/29/2008 10:08:46 AM

nha, I think I am able to do that in coding. but my need is I have to drag some control from toolbox and drop it into my custom control (consider customPanel). Means I need to create control as panel as working with some extra custom propoerties

4/29/2008 11:54:24 AM

Ok sorry Smile

I have never done, but you can try to take a look to [Designer(typeof(ContainerControlDesigner))] decoration. You need to add a reference to System.Design.dll.

Take a look to:


Wamba {WamBlog}
Dont forget to click "Mark as Answer" on the post that helped you.
This credits the member,earns you a point & marks your thread as Resolved.
4/29/2008 1:26:38 PM

Hi ,

Those links are really useful.I got it.

Thanks lot.


4/30/2008 4:04:09 AM

Similar Artilces:

How to create custom properties for aspx page which should refelect in design time properties window itself.( as like as custom server control).
Hi. I need to create the custom properties for aspx page itself where those custom properties should refelet in the properties window at the design time as like as other custom server controls. I tried pageBase class which will have cusom properties for page and inherited that pageBase to my aspx page . But its refelecting the code  behind file not in design time. I need to accss those aspx page custom properties at the design time itself in properties window as like as other custom server control.I appriciate your help. [FYI: my scenerio is customer ...

Dragging controls in to a custom control at design time
I am creating a custom control that will contain a panel so that developers can drag other controls into it at design time. If I create a control that inherits from Panel this works no problem. But I need a composite control that may contain more than one Panel and this does not seem to work. I'm assuming I need to hard code support for dragging in controls. Does anyone have any ideas??...

Custom server control developement-panel like control
Dear all,  i am developing a custom composite server control. it consists of buttons, image controls in it. along with this. i would like to add one more control like a panel, so that the developers can drag and drop any web server control over my custom web server control in the design time. is this possible. if so how should i go about it.   regards, sundararajan.sSundararajan.S yes it's possible, you have to implement a designer class inherted from "TemplatedControlDesigner" Hi, thank you. can you please throw some more light on the same. any samples.   regards,...

Can we use existing Server Controls to create Custom Controls?
Can we use the existing ASP.Net Server Controls to create Custom Controls? I am able to use HtmlTextWriter to make my Custom Controls. I want to be able to add regular ASP.Net server controls to create my Custom Controls. Is this possible? Can anyone provide a sample? Basically, you just need to inherit the control you want to use, like this: Public Class MyControl Inherits System.Web.UI.WebControls.TextBox Then you can override the methods you want and add code as needed. Peter BrunoneMS MVP, ASP.NETFounder, EasyListBox.comDo the impossible, and go home early. The str...

Creating Custom Controls With Custom Controls Inside Of Them
Hello, I am trying to create a custom control for creating tabs. The idea is that our designer can just use the control tags to generate the tabs.  The problem that I am running into is that I want to be able to have a custom control that allows any number of child custom controls. So there would be a TabContainer Control, and within that there would be any number of tabs.  The idea is similar to how an asp:DropDown list can have any number of ListItems within them.  Here is my code, any help is appreciated. 1 <!-- TAB CONTAINER -->2 <%@ Control Language=&...

Custom Server Control Made of Custom Controls?
I'm giving myself a crash course in custom server controls, and I have a quick general question. Can I have a custom server control that is composed of other server controls I created. I'm pretty sure the answer is yes, but I want to be positive. Yes Shows how to combine existing controls into a new control using class composition. -ron Thanks! ASP.NET so rocks! Making page components extensible objects is such a great idea! I love it....

Usercontrol vs Custom Server Controls, Any need for Custom Server Controls
Hello I'm new to ASP.Net so this is probably a stupid question but, is there any need to create customer server controls now that you can pre-compile usercontrols into a dll and thus easily share between applications? This blog post from David Ebb describes how to do it and the restrictions he note don't seem that bad (other than being able to embed resources such as images in the dll). His article desribes the techniques for ASP.Net 2.0 and he suggests that there will be further improvements in .Net 3.5 in this ar...

how to have both server controls and html controls rendered in a custom control?
I have a custom control in which there is an html text box.when you click on it , a div containing a table is appeared and according to what you select in that table a text is set to the text box. It works fine but the problem is: as the text box is an html element it doesn't have viewstate and when a post back occures in the page its value disappeares.I tried a hidden field to keep its value.again there is another problem : I put this custom control in a usercontrol and put the usercontrol in a multiview and by clicking on a button this view is selected and by clicking another bu...

Design-time problem with TableStyle property of custom control
Hi all,I've been writing custom menu control (inherited from HierarchicalDataBoundControl). Everything (both run-time and design-time) worked just fine, until I added new property like this:         private TableStyle tableStyle;        [Category("Styles")]        [PersistenceMode(PersistenceMode.InnerProperty)]        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]        public virtual TableStyle Tabl...

Custom Server Control Vs Web Parts, Any need for Custom Server Control
Hello I've just posted a similar question on why you need server controls when you can pre-compile usercontrols and redistribute them. I've seen lots of (usercontrol vs web part) but not much on web part vs custom server control. According to the MSDN site you can put web parts onto a normal page outside of a web part zone and they behave just like custom server controls. So, if you are creating a bunch of controls for redistribution to customer sites and/or SharePoint sites why don't you just create Web Par...

problems listenening to events on a custom server control from another custom server control
 Hi all,I am having problems listening to events on one of custom server controls(AddBookmark) from another custom server control(BookmarkList). The listener or the BookmarkList control has a property that can be set to the AddBookmark control (string at design but the reference is obtained at run-time). I am able to get a reference to the AddBookmark control and add a listener to it on the BookmarkList control on the OnPrender of BookmarkList. But the problem is that when the events on AddBookmark gets fired, the listener added from the BookmarkList is no longer present and the listene...

Custom Control within a Control Control
I am developing a custom controls that will render headers for different web sites. Within these controls, I want to place another custom control that will change the language. I created the language control and had it implement IPostBackDataHandler. This control works fine if I drag it on a new web form, but if I tell a header custom control to render it problems occur. The Language Selector custom control does not have a Page member anymore and the event handlers do not work. Does anyone have any experience with doing something similiar? Anyone have any suggestions? Thanks, ...

Custom Control within a Custom Control
I have two individual custom controls say custom cc1 and cc2. cc1 is communicating to cc2 using event delegate mechanism.I have tested the behaviour by dropping cc1 and cc2 onto a Web Page and it works fine. I want to create a third custom control say cc3 which should contain both cc1 and cc2. So that if i drag and drop cc3 onto a Web Page i can acheive exactly what i am doing above. The problem is that i am not sure how to call/register a custom control within a custom control ? Any clue ? Thanks!! Hi, Do you mean adding custom control to custom control? I think you can use the same wa...

Proper way to add to Control collection from a custom server control?
Hi there,I'm creating a custom server control inheriting from TextBox. If a property ("IsRequired") indicates so, I want to add to a RequiredField validator to the mix. Below is what I am doing, though I get the exception "The control collection cannot be modified during DataBind, Init... etc."So how would be the proper way to do it?Thanks a lot, -Benton---------------------------------- using System;using System.Drawing;using System.Web.UI;using System.Web.UI.WebControls;using System.ComponentModel;using RequiredVal = Microsoft.Web.UI.Compatibility.RequiredFieldValidator;namespace...

Web resources about - simple way to create a custom control (like Panel) that you can drag and drop other controls into at design time -

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

DFES downgrades bushfire in Dunsborough as it is contained, but not under control
A BUSHFIRE south of Dunsborough has been contained but is not yet under control.

Queensland police shut down out-of-control party in Berserker, Rockhampton
Police shut down a party of 150 young people who had gathered at a house in Berserker, Rockhampton on Friday night.

Contextual and Granular Notification Controls
... written a lot about notifications, at one point calling the notifications screen “my home screen.” But I don’t like how we are forced to control ...

ESI cost control and networks
There is an interesting discussion thread on Twitter about how the way Medicare for All saves money is by significantly reducing provider, device, ...

US Democratic debate: Candidates spar on gun control
Candidates in the Democratic race for the White House hold their liveliest TV debate yet, clashing over gun control and healthcare among other ...

Doro PDF printer adds color conversion, page rotation controls
Lightweight virtual PDF printer Doro has been updated with new color conversion and page rotation settings. If the default "UseDeviceIndependentColor" ...

While No One Was Watching, Obama Took Control of the Courts
... and President Obama’s legacy.” It didn’t favor conservatives but there was a dramatic shift to the far left. The appellate is under the control ...

Sanders Backs Gun Control Legislation Ahead of Democratic Debate
Hillary Clinton's campaign calls her rival's move a "debate-eve conversion."

Apple has landed a very rare sponsorship deal to ensure it has control of the hottest ticket in San Francisco ...
Apple has signed up for the first time to become a sponsor of the Super Bowl Host Committee, Daniel Roberts at Yahoo Finance reported. It's ...

Resources last updated: 1/18/2016 9:58:43 PM