Groups | Blog | Home
all groups > asp.net building controls > december 2003 >

asp.net building controls : How to implement Drop down list in "properties" box?


Oleg Slyuasrchuk
12/10/2003 4:56:57 PM
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 Slyusarchuk
12/12/2003 12:54:43 PM
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 ***
Teemu Keiski
12/12/2003 9:34:14 PM
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/default.asp?url=/library/en-us/cpguide/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

[quoted text, click to view]

AddThis Social Bookmark Button