|
xxx
DropDownList, ListBox Core
Methods
by Charles Carroll
DropDown Lists and Listboxes are
easy to fill but unless one learns a few of the core methods they can be
frustrating.
dropWhatever.Items.Insert(0, New ListItem("
--please choose state--", -1))
- Select an Item In Multi-select List:
dropWhatever.Items.FindByValue("MD").Selected=true
- Find The Value via the corresponding
text
drpP1.SelectedIndex = drpP1.Items.IndexOf(drpP1.Items.FindByValue("MD"))
- Act only on Selected Items
dim listitem1 as listItem
For Each listItem1 In listboxWhatever.Items
If oItem.Selected = true then
' do something with selected items
END IF
NEXT
System.Web.UI.WebControls.ListItem is fully
qualified name.
 |  |  |
 |
There are many worthy charities!!. But perhaps help starving children in Africa or South America AND help Charles too.
a $5 tip buys him lunch at McDonalds,
a $20 tip buys his kid Hitoshi a new computer game,
a $39 tip buys his daughter Michiko a few nice outfits.
See our donor list.
|  |
 |  |  |
|
|
|
|