How to implement Drop down list in "properties" box?

Discussion in 'ASP .Net Building Controls' started by Oleg Slyuasrchuk, Dec 10, 2003.

  1. Hi All,

    It may be seem easy, but:

    How do I implement a public property that I want to be able to select from a
    list of predefined values (at design time)?
    Like, for example, "BackColor" in "Apperance" section.( Even without any
    extras as a dialog or populating from DB)
    Thanks,

    Oleg
    Oleg Slyuasrchuk, Dec 10, 2003
    #1
    1. Advertising

  2. Oleg Slyuasrchuk

    Teemu Keiski Guest

    Either,

    a) specify an enumeration and assign it as the type of the property. This
    way it is automatic.

    b) If you need more dynamic way you can create a custom typeconverter.

    http://msdn.microsoft.com/library/d...guide/html/cpconimplementingtypeconverter.asp

    See: Type Converters That Provide a List of Standard Values to a Property
    Grid

    c). The most powerful way is to create custom editor. See documentation for
    design.time features.

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist

    "Oleg Slyuasrchuk" <> wrote in message
    news:%...
    > Hi All,
    >
    > It may be seem easy, but:
    >
    > How do I implement a public property that I want to be able to select from

    a
    > list of predefined values (at design time)?
    > Like, for example, "BackColor" in "Apperance" section.( Even without any
    > extras as a dialog or populating from DB)
    > Thanks,
    >
    > Oleg
    >
    >
    >
    Teemu Keiski, Dec 12, 2003
    #2
    1. Advertising

  3. Thank you, Teemu


    I userd the first approach and achieved what I wanted so far.

    I'll investigate the "design.time features" topic deeper when I need it.

    Regards,
    Oleg



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Oleg Slyusarchuk, Dec 12, 2003
    #3
    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. SirPoonga
    Replies:
    2
    Views:
    735
    Ben Strackany
    Jan 7, 2005
  2. weiwei
    Replies:
    0
    Views:
    994
    weiwei
    Jan 5, 2007
  3. msimmons
    Replies:
    0
    Views:
    449
    msimmons
    Jul 16, 2009
  4. Replies:
    5
    Views:
    244
  5. Replies:
    3
    Views:
    270
Loading...

Share This Page