Creating Custom Control with Dynamic Data

I

Isai

Hello,

I am using VB.NET in Visual Studio 2005 to develop ASP.NET 2.0 web
applications. I am developing a control library with all the custom
controls that I can use in my projects. One of the requirement is to
build a custom DropDownList with addition functionalities specific to
my project. When I tried to develop this control I faced a problem
that I have explained below.

I want to add a new property for this custom DropDownList. This
property will take a string value but it must come from a predefiined
set of values. This predefined set is dynamically built from a SQL
Server table and must be shown to the user as available values in the
properties window. I cannot use an enum because the values come from
a table.

Please let me know if someone has any suggestions.

Thanks, Isai.
 
J

jdlwright

Hi Isai, firstly you might want to try the control building newsgroup
as it's more specialised.
I am using VB.NET in Visual Studio 2005 to develop ASP.NET 2.0 web
applications. I am developing a control library with all the custom
controls that I can use in my projects. One of the requirement is to
build a custom DropDownList with addition functionalities specific to
my project. When I tried to develop this control I faced a problem
that I have explained below.

I want to add a new property for this custom DropDownList. This
property will take a string value but it must come from a predefiined
set of values. This predefined set is dynamically built from a SQL
Server table and must be shown to the user as available values in the

What you mean is, you want to hit the database at design time and fill
in a dropdown list in the VS property editor, so that the developer
user can choose a value?

If so I think you might want to look at the Editor attribute which can
be assigned to the class of property that you want the drop down to
appear for. You're probably going to need to delve into
UITypeEditor...

Hope that's some help
Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top