ExpandableObjectConverter (Almost Working)

Discussion in 'ASP .Net Web Controls' started by Ron Vecchi, Nov 23, 2003.

  1. Ron Vecchi

    Ron Vecchi Guest

    I have a custom control inheriting from System.Web.UI.Control. I
    implemented the ExpandableObjectConverter and everything is working fine in
    the designer. The proerty is expanded and I can select the child properties
    and the change is displayed to the parent.

    When my custom control renders, an html atribute is created from the values
    of both child properties of the parent property. ex (salign="LB").
    How can I get this to show up in my Html View when I set the child
    properties in design view? Right now nothing is displayed in the controls
    html view when I change the properties in design. Also when I build my
    project my newly set child properties are rcleared from the poperties
    window.


    ////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////
    //////////////////// Custom control property
    ///////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////
    [Browsable(true),
    Description("Gets or Sets the Flash Horizontal and Vertical Alignment
    Parameters."),
    Category("Alignment"),
    PersistenceMode(PersistenceMode.InnerProperty),
    DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
    public FlashMovieAlignment FlashAlignment {
    get {return this._mflashalign;}
    set {this._mflashalign = value;}
    }

    ////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////
    //////////////////// Class that is Expandable in design view of custom
    control ////
    ////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////
    [TypeConverter(typeof(ExpandableObjectConverter))]
    public class FlashMovieAlignment {

    private FlashHorizontalAlignment _halign;
    private FlashVerticalAlignment _valign;



    [DefaultValue(typeof(DHelixWebControls.UI.FlashHorizontalAlignment),"Center"
    ),
    NotifyParentProperty(true),
    RefreshProperties(RefreshProperties.Repaint)]
    public FlashHorizontalAlignment HorizontalAlign {
    get {return this._halign;}
    set {this._halign = value;}
    }


    [DefaultValue(typeof(DHelixWebControls.UI.FlashVerticalAlignment),"Center"),
    NotifyParentProperty(true),
    RefreshProperties(RefreshProperties.Repaint)]
    public FlashVerticalAlignment VerticalAlign {
    get {return this._valign;}
    set {this._valign = value;}
    }


    public FlashMovieAlignment() {

    this.Initialize(FlashHorizontalAlignment.Center,FlashVerticalAlignment.Cente
    r);
    }
    }


    Thanks
    --
    Ron Vecchi
    Ron Vecchi, Nov 23, 2003
    #1
    1. Advertising

  2. Ron Vecchi

    MSFT Guest

    Hi Ron,

    You may take a look at following article to see if it will help:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
    l/cpconcontrolparsingcustomattributescontrolbuilders.asp

    Especailly, you may try to create a custom ControlBuilder class to see if
    it will help. For more information on web controls design time support, you
    may refer to:

    http://longhorn.msdn.microsoft.com/lhsdk/ndp/cpconenhancingdesign-timesuppor
    t.aspx

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    MSFT, Nov 24, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rajas Sambhare

    libmysqld.dll almost working in python...

    Rajas Sambhare, Jan 6, 2004, in forum: Python
    Replies:
    0
    Views:
    533
    Rajas Sambhare
    Jan 6, 2004
  2. Bart Nessux
    Replies:
    3
    Views:
    296
    =?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?=
    Jul 3, 2004
  3. stefano mostarda

    ExpandableObjectConverter

    stefano mostarda, Oct 10, 2003, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    238
    Nigil LaVey
    Nov 2, 2003
  4. terrorix

    MyCustomControl, ExpandableObjectConverter, OnValueChanged

    terrorix, May 14, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    150
    terrorix
    May 14, 2004
  5. layos

    Help on ExpandableObjectConverter

    layos, Jan 15, 2008, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    261
    PJ on Development
    Jan 23, 2008
Loading...

Share This Page