Create a dropdown list of valid property values for a custom control

I've created a custom user control that has several properties. One specifies which database I want the control to access. I want to be able to present the user of the control a drop down from which he can select which database the control will interact with.

How do I get the dropdown to work? I can get default values, but have yet to figure out how to get the selectable list.

Any help is apprectiated.

Thanks.

Marshall

Answers


You just need to attach your own TypeConverter to your property. You will override the GetStandardValuesSupported and GetStandardValues methods (maybe GetStandardValuesExclusive too) to return the list of databases you want to show.

If you are new to the PropertyGrid and the TypeConverter, here is a document.


Need Your Help

Abap: importing a generic table from a memory area - can/should it be done?

memory import export abap

I am exporting a dynamicaly created internal table to memory.

Div next to div

html css

I have two divs and i want div2 will be next to div1. I tried use float:left and display:inline but nothing help.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.