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. Advertisements

  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. Advertisements

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:
    610
    Rajas Sambhare
    Jan 6, 2004
  2. Bart Nessux
    Replies:
    3
    Views:
    380
    =?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?=
    Jul 3, 2004
  3. David. E. Goble
    Replies:
    9
    Views:
    732
    David. E. Goble
    Feb 2, 2005
  4. DanWeaver
    Replies:
    0
    Views:
    356
    DanWeaver
    Apr 13, 2008
  5. richard

    almost working right

    richard, Apr 14, 2008, in forum: HTML
    Replies:
    2
    Views:
    480
    BootNic
    Apr 15, 2008
  6. stefano mostarda

    ExpandableObjectConverter

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

    MyCustomControl, ExpandableObjectConverter, OnValueChanged

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

    Help on ExpandableObjectConverter

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