ImageUrlEditor on subcontrol does not work


R

Ray

I have a WebControl which contains another WebControl. Both have an ImageUrl property, code see below
In the property grid the ImageUrlEditor works on the parent control but not on the subcontrol's expanded property
This may or may not be related with the problem that other subproperties are not refreshed automatically and that the subproperty's designer is never called
Thanks for any suggestions
Ra

namespace Test

[ ParseChildren(false)
ToolboxData("<{0}:TestControl runat=server></{0}:TestControl>")
public class TestControl : System.Web.UI.WebControls.WebContro

private Tests.SubControl tsc = new SubControl()
private string mstrImageUrl = string.Empty

[ Description("Test subproperty.")
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)
PersistenceMode(PersistenceMode.InnerProperty)
public Tests.SubControl SubControl
get { return tsc;
set { tsc = value;


[ DefaultValue("")
Editor(typeof(System.Web.UI.Design.ImageUrlEditor),typeof(System.Drawing.Design.UITypeEditor))
public string ImageUrl
get { return mstrImageUrl;
set { EmstrImageUrl = value;

} //END public class TestContro

public class SubControl : System.Web.UI.WebControls.WebContro

private string mstrImageUrl = string.Empty

[ DefaultValue("")
Editor(typeof(System.Web.UI.Design.ImageUrlEditor),typeof(System.Drawing.Design.UITypeEditor))
public string ImageUrl
get { return mstrImageUrl;
set { mstrImageUrl = value;

} //END public class SubContro

} //END namespace Tests
 
Ad

Advertisements

R

Ray

I found the answer to the main question in another forum: This seems
to be a MS known issue, see http://www.asp.net/Forums/ShowPost.aspx?
tabindex=1&PostID=269214.

The subproperty refresh can be fixed by applying the
NotifyParentPropertyAttribute to the property. I had to override the
property to set the attribute and make it work.

So there remains the 'subproperty's designer is never called'
question. Any help?

Cherio
Ray
 

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

Top