Design time rendering of a composite custom web control

  • Thread starter Thread starter Barry Carr
  • Start date Start date
B

Barry Carr

Hi,

I've created a composite custom web control and a ControlDesigner
descendant to render the control a design time.

The child controls are public properties of composite control and as such
the child controls appear in the property inspector as sub-properties of
the main control and can be manipulated as normal at design time. If any of
the properties of the parent (main) control are changed at design time the
composite control is updated (re-rendered) in the designer to reflect the
change. However, if any of the properties of the child controls are changed
in the property inspector the control is not updated in the designer.

So my qestion is this: is there a way to get the whole control to be re-
rendered at designtime if any of the properties of the child controls are
updated? I've tried the NotifyParent Attribute on the child control
properties but this doesn't appear to work. Any help would be appreciated.

Thanks

Regards

Barry Carr
 
I'm using this trick from control designers :

I create public Refresh method for the control :

public void Refresh()
{
EventArgs e = new EventArgs();
this.OnPreRender(e);
}

every time i call that public method the control render itself.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 
Hi Natty,

Thanks for this. Am I right in thinking that this is a runtime solution?
If it is then it doesn't quite meet my needs, my problems are at design
time.

Regards

Barry Carr
 
Hi Natty,

I see where you are coming from now. However I'm not using a custom control
designer (I'm assuming that you mean some sort of custom dialog created to
manipulate a component at design time).

Since I posted my original message I've more or less resigned myself to
surfacing the properties I need on the child controls as properties of the
main control. I noticed that although a child control appeared in the
poroperty inspector as expected its events did not appear; which, is pretty
much useless so I'll have to "manually" surface the properties and events
that I need.

Thanks for your help.

Cheers

Barry Carr
 
Back
Top