Thank you for your kindly relply. But if the complex type property need
> As it's complex type, property should be read-only
>
> ...
> public SQLSettings SQLSettingsData
> {
> get
> {
> if (this._sqlSettings =3D=3D null)
> this._sqlSettings =3D new SQLSettings();
> return this._sqlSettings;
> }
>
> }
>
>
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
>
http://blogs.aspadvice.com/joteke >
>
> <yp.yean@gmail.com> wrote in message
> news:1156393251.472673.191100@i3g2000cwc.googlegroups.com...
> > Hi,
> >
> > I created a custom control, and encountered a dirty property value
> > persistence problem.
> > I created a property with a custom class type, call SQLSettings which
> > holds the SQL connection parameters, the class as follows:
> >
> >
> > public sealed class SQLSettings
> > {
> > private string serverName;
> > .......
> >
> >
> > public SQLSettings()
> > {
> > this.serverName =3D string.Empty;
> > ......
> > }
> >
> >
> > [NotifyParentProperty(true)]
> > public string ServerName
> > {
> > get
> > {
> > return this.serverName;
> > }
> > set
> > {
> > this.serverName =3D value;
> > }
> > }
> > ..................
> >
> >
> > And, I also created an mapping TypeConverter and UITypeEditor classes
> > to handle the design-time founctinality. The property I created in my
> > conbtrol as follows:
> >
> >
> > [BrowsableAttribute(true)]
> > [CategoryAttribute("Behavior")]
> > [BindableAttribute(true)]
> > [NotifyParentProperty(true)]
> > [EditorAttribute(typeof(SQLSettingsUITypeEditor),
> > typeof(UITypeEditor))]
> >
> > [DesignerSerializationVisibility(DesignerSerializationVisibility.Conten=
t)]
> >
> > [TypeConverter((Type)typeof(SQLSettingsTypeConverter))]
> > [PersistenceModeAttribute(PersistenceMode.InnerProperty)]
> > public SQLSettings SQLSettingsData
> > {
> > get
> > {
> > return this._sqlSettings;
> > }
> > set
> > {
> > this._sqlSettings =3D value;
> > }
> > }
> >
> >
> > They all works fine when first set value to this property, I can see
> > the persisted data showed in .aspx file. When I go back to design view
> > and update the property value via my UITypeEditor, I can see the value
> > already updated in VS.NET properties browser. But when I turn to see
> > .aspx file in code view, I didn't see the dirty property value updated
> > in .aspx file. When I turn to design view, the updated property value
> > is lost, it remain keep the first persisted value.
> >
> >
> > How to solve this problem? Any idea?
> > Thank you for your kindly help.
> >