Need to mimic Panel WebControl's design-time features


Jeff Bowman

I've created a custom server control that inherits from the Panel WebControl,
and for the most part I've gotten it to behave the way I want at run time
(there're a couple of quirks, but nothing serious). At design time, however, is
a different story.

For some reason the native design time behaviors of the Panel were lost when I
did this. I no longer have the ability to click within the control and edit its
contents, drag-and-drop child controls into it, etc.

How can I have the native design time behavior flow down to my custom control?




Jeff Bowman

mercede said:
I have the same problem. I made a composite control derived from a regular
control and adding a panel to the child control but it does not work at all

Hi Mercede

I was able to get it to work by setting my custom panel's designer to inherit
from the native PanelDesigner, like so:

<Designer("InteXX.WebControls.FieldSetPanelDesigner"), _
ToolboxData("<{0}:FieldSetPanel runat=server></{0}:FieldSetPanel>")> _
Public Class FieldSetPanel
End Class

Public Class FieldSetPanelDesigner
Inherits System.Web.UI.Design.WebControls.PanelDesigner

Protected Overrides Sub OnBehaviorAttached()
End Sub

Public Overrides Sub OnComponentChanged(ByVal toSender As Object, ByVal
toEventArgs As ComponentChangedEventArgs)
End Sub
End Class

I don't know if this will work with a composite control, though.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question