|
-
Mar 28th, 2008, 12:00 PM
#1
Thread Starter
Fanatic Member
[2005] User control property to have a drop down list of values
I am developing a web user control and have a property exposed of type object. What I want is that when this user control is placed on a web form this property will pick up all the textboxes and give the user an option to choose from those values. Something very similar to what we've in CompareValidator where we get to choose the name of the control to compare etc. Any ideas where I should start from? Thanks.
-
Mar 28th, 2008, 01:40 PM
#2
Fanatic Member
Re: [2005] User control property to have a drop down list of values
Create an Enum with the properties
vb Code:
Public Enum PropertiesEnum Item1 Item2 Item3 End Enum Public Property PropertyTest() As PropertiesEnum Get Dim intValue As Integer = Cint(ViewState("PropertyTest")) Return intValue End Get Set (byval value As PropertiesEnum) ViewState("PropertyTest") = value End Set
Warren Ayen
Senior C# Developer
DLS Software Studios ( http://www.dlssoftwarestudios.com/)
I use Microsoft Visual Studio 2005, 2008, working with Visual Basic and Visual C#
Hey! If you like my post, or I solve your issue, please Rate Me!
-
Mar 28th, 2008, 03:36 PM
#3
Thread Starter
Fanatic Member
Re: [2005] User control property to have a drop down list of values
Thanks Warren for the reply but that's not what exactly I'm trying to achieve. Let me try to explain it again.
a.) On a web form I'll place my user control.
b.) User control has a property, TextBoxToFill.
c.) Developer will go into the property and then he should see a list of all the textboxes that are available on the current web form (where the user control has been placed).
What I've tried so far:
In a CustomCompareValidator I've put the attribute
Code:
TypeConverter(GetType(ControlIDConverter))
before a property and that property is able to pick up all the available controls on the form where it has been placed. But when I put the same attribute in this user control it doesn't work. ANy idea why would it be so?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|