Couldn't create parent property with child properties expanded by plus sign...

Discussion in 'ASP .Net Web Controls' started by Emil Georgiev, May 17, 2004.

  1. Hello
    I have a Web Custom Control project in ASP.NET. I'm using a subclassing technique to add functionality in HyperLink web

    server control. I want to create a property "BrowserWindow" of my class "NewWinHyperLink" which will contain child

    properties. When I use this custom control in testing web application these child properties don't appear with 'plus sign' in

    visual studio designer. I want to make my parent property to have plus sign in order to expand in VS designer and adjust its

    child properties (e.g. look at any web server contol and notice the Font property which have plus sign)
    here is my sample code where I want to make BrowserWindow property appears with plus sign:

    namespace CustomControl
    {
    [ToolboxData("<{0}:NewWinHyperLink runat=server></{0}:NewWinHyperLink>")]
    public class NewWinHyperLink : System.Web.UI.WebControls.HyperLink
    {
    protected override void OnInit(EventArgs e)
    {
    base.Text = this.ID;
    NavigateUrl = "#";
    // Do whatever the control usually does OnInit
    base.OnInit(e);
    }

    private BrowserWindowInfo bwi = new BrowserWindowInfo();

    [Browsable(true),
    Bindable(true),
    Category("Design")]
    public BrowserWindowInfo BrowserWindow //doesn't appear with plus sign!
    {
    get
    {
    return bwi;
    }
    set
    {
    bwi = value;
    }
    }

    }

    public class BrowserWindowInfo
    {
    // String settings: default is blank.
    private string m_strURL = "about:blank";
    // Integer settings: 0 invoked default.
    private int m_Height = 0;
    private int m_Width = 0;


    [Browsable(true),
    Bindable(true),
    Category("Appearance")]
    public string URL
    {
    get
    {
    return m_strURL;
    }
    set
    {
    m_strURL = value;
    }
    }

    [Browsable(true),
    Bindable(true),
    Category("Appearance")]
    public int Height
    {
    get
    {
    return m_Height;
    }
    set
    {
    m_Height = value;
    }
    }

    [Browsable(true),
    Bindable(true),
    Category("Appearance")]
    public int Width
    {
    get
    {
    return m_Width;
    }
    set
    {
    m_Width = value;
    }
    }

    }
    }

    Can anyone please give me some hint? Do u think if I miss any attribute only?

    Thanx.
    Emil Georgiev, May 17, 2004
    #1
    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. =?Utf-8?B?RW1pbCBHZW9yZ2lldg==?=
    Replies:
    0
    Views:
    468
    =?Utf-8?B?RW1pbCBHZW9yZ2lldg==?=
    May 16, 2004
  2. qwweeeit
    Replies:
    2
    Views:
    646
    qwweeeit
    Dec 14, 2005
  3. ton
    Replies:
    2
    Views:
    2,152
  4. Noel Dolan
    Replies:
    0
    Views:
    229
    Noel Dolan
    Jul 18, 2004
  5. Bitswapper
    Replies:
    5
    Views:
    135
    Prasad, Ramit
    Aug 27, 2013
Loading...

Share This Page