[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.buildingcontrols

Updating Custom Control at Design Time

Mark Olbert

2/18/2007 11:55:00 PM

Okay, I'm confused: I have a custom composite control which has several "steps". I've created the DesignerActionList infrastructure
to move between the steps at design time. The methods that control the movement get called, the "step state" gets changed...but the
design surface doesn't update to reflect the change. Not even after I call RaiseComponentChanged() within my custom designer.

So...how to I "invalidate" the design surface so that GetDesignTimeHtml() will be called again??

- Mark
3 Answers

wawang

2/20/2007 9:55:00 AM

0

Hi Mark,

If your properties are marked with
[PersistenceMode(PersistenceMode.InnerProperty)] and you changes the value
of one of those properties, you can call OnComponentChanged() from within
your custom control designer and this will cause the control to get
persisted again:

OnComponentChanged(Component, new ComponentChangedEventArgs(Component,
null, null, null));


Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

wawang

2/23/2007 7:40:00 AM

0

Hi Mark,

What do you think of above suggestion? Does it help?

Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Mark Olbert

2/24/2007 4:56:00 AM

0

Walter,

Sorry about the delay in replying, I've been busy working on my control.

The approach that I finally found to work is to call UpdateDesignTimeHtml() from those objects that have access to the designer, and
setting the property via a propertyinfo construct (e.g., in a custom UITypeEditor). That covers almost everything.

- Mark