473,396 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How To: Dropdown value for subclassed property

Hello,
I'm trying to subclass a web page button to add a property for security.
The sub-classed web form will read security and cycle though the objects on
the page to decided what needs to be disabled.

After I got it up and running, I thought it would be much nicer if it had a
dropdown list of the securities available rather then inputting a number.
Any suggestions or pointers would be appreciated.

This is what I tried that didn't work...

Imports System.ComponentModel
Imports System.Web.UI
Imports System.Drawing
Imports System.Drawing.Color
Imports System.Web.UI.WebControls

<ToolboxBitmap(GetType(System.Web.UI.WebControls.B utton))> _

Public Class Button
Inherits System.Web.UI.WebControls.Button
Private intSecurity As Int16 = 0
Private ddlSecurityList As DropDownList

<Description("Controls what permission affects the button."), _
Category("Behavior")> _
Public Property DisabledBy() As DropDownList

Get
Return ddlSecurityList
End Get

Set(ByVal Value As DropDownList)
ddlSecurityList.SelectedIndex = Value.SelectedIndex
intSecurity = ddlSecurityList.SelectedItem.Value
End Set
End Property

Public Sub New()
MyBase.New()

Dim mySortedList As New System.Collections.SortedList()
Dim Item As DictionaryEntry
mySortedList("0") = "None"
mySortedList("1") = "Read/Visable"
mySortedList("2") = "Write/Enabled"
mySortedList("3") = "Edit"
mySortedList("4") = "Delete"

For Each Item In mySortedList
Dim newListItem As New System.Web.UI.WebControls.ListItem()
newListItem.Text = Item.Value
newListItem.Value = Item.Key
ddlSecurityList.Items.Add(newListItem)
Next
End Sub

End Class
Nov 20 '05 #1
0 793

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Manish | last post by:
Hi All, I'm having this problem I hope someone can help provide a solution for it :) I've this dropdown list box in a usercontrol which I'm populating from the database (it's viewstate property...
5
by: Kris Rockwell | last post by:
Hello (again), I have gotten the dropdown list functionality to work through a few tricks (probably not the most efficient, but it works) but I am not sure how to set the default selected value....
1
by: Norm Katz | last post by:
When you use a bound combobox and you set its dropdown style to "dropdown" that allows you to enter text in the edit box. But if you enter anything other than a value in the current bound items...
0
by: Kay | last post by:
Hello, I have developed a web custom control, I want one of the properties of the control to appear as a dropdown list so the user can select from the list. My question is: how do I define an...
0
by: Kay | last post by:
Hello, I have developed a web custom control, I want one of the properties of the control to appear as a dropdown list so the user can select from the list. My question is: how do I define an...
5
by: jung_h_park | last post by:
From: jung_h_park@yahoo.com Newsgroups: microsoft.public.dotnet.framework.aspnet Subject: Dropdown List not retaining its SelectedValue Date: Mon, 26 Jun 2006 21:02:57 -0700 Hello, My...
0
by: Kay | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
0
by: Kay O'Keeffe | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
5
by: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== | last post by:
I have a VS 2008 ASP.NET webform that has a reportview tag on it, accessing an .RLDC report in local report. The columns for the report are essentially: Month Item #1 Item#2 Item#3 ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.