ASP.NET ListBox - Get Selected Item

  • Alfreds FutterkisteALFKI
  • Ana Trujillo Emparedados y heladosANATR
  • Antonio Moreno TaqueríaANTON
  • Around the HornAROUT
  • Berglunds snabbköpBERGS
  • Blauer See DelikatessenBLAUS
  • Blondesddsl père et filsBLONP
  • Bólido Comidas preparadasBOLID
  • Bon app'BONAP
  • Bottom-Dollar MarketsBOTTM
  • B's BeveragesBSBEV
  • Cactus Comidas para llevarCACTU
  • Centro comercial MoctezumaCENTC
  • Chop-suey ChineseCHOPS
  • Comércio MineiroCOMMI
  • Consolidated HoldingsCONSH
  • Die Wandernde KuhWANDK
  • Drachenblut DelikatessenDRACD
  • Du monde entierDUMON
  • Eastern ConnectionEASTC
  • Ernst HandelERNSH
  • Familia ArquibaldoFAMIA
  • FISSA Fabrica Inter. Salchichas S.A.FISSA
  • Folies gourmandesFOLIG
  • Folk och fä HBFOLKO
  • France restaurationFRANR
  • Franchi S.p.A.FRANS
  • FrankenversandFRANK
  • Furia Bacalhau e Frutos do MarFURIB
  • Galería del gastrónomoGALED
  • Godos Cocina TípicaGODOS
  • Gourmet LanchonetesGOURL
  • Great Lakes Food MarketGREAL
  • GROSELLA-RestauranteGROSR
  • Hanari CarnesHANAR
  • HILARION-AbastosHILAA
  • Hungry Coyote Import StoreHUNGC
  • Hungry Owl All-Night GrocersHUNGO
  • Island TradingISLAT
  • Königlich EssenKOENE
  • La corne d'abondanceLACOR
  • La maison d'AsieLAMAI
  • Laughing Bacchus Wine CellarsLAUGB
  • Lazy K Kountry StoreLAZYK
  • Lehmanns MarktstandLEHMS
  • Let's Stop N ShopLETSS
  • LILA-SupermercadoLILAS
  • LINO-DelicatesesLINOD
  • Lonesome Pine RestaurantLONEP
  • Magazzini Alimentari RiunitiMAGAA
  • Maison DeweyMAISD
  • Mère PaillardeMEREP
  • Morgenstern GesundkostMORGK
  • North/SouthNORTS
  • Océano Atlántico Ltda.OCEAN
  • Old World DelicatessenOLDWO
  • Ottilies KäseladenOTTIK
  • Paris spécialitésPARIS
  • Pericles Comidas clásicasPERIC
  • Piccolo und mehrPICCO
  • Princesa Isabel VinhosPRINI
  • Que DelíciaQUEDE
  • Queen CozinhaQUEEN
  • QUICK-StopQUICK
  • Rancho grandeRANCH
  • Rattlesnake Canyon GroceryRATTC
  • Reggiani CaseificiREGGC
  • Ricardo AdocicadosRICAR
  • Richter SupermarktRICSU
  • Romero y tomilloROMEY
  • Santé GourmetSANTG
  • Save-a-lot MarketsSAVEA
  • Seven Seas ImportsSEVES
  • Simons bistroSIMOB
  • Spécialités du mondeSPECD
  • Split Rail Beer & AleSPLIR
  • Suprêmes délicesSUPRD
  • The Big CheeseTHEBI
  • The Cracker BoxTHECR
  • Toms SpezialitätenTOMSP
  • Tortuga RestauranteTORTU
  • Tradição HipermercadosTRADH
  • Trail's Head Gourmet ProvisionersTRAIH
  • VaffeljernetVAFFE
  • Victuailles en stockVICTE
  • Vins et alcools ChevalierVINET
  • Wartian HerkkuWARTH
  • Wellington ImportadoraWELLI
  • White Clover MarketsWHITC
  • Wilman KalaWILMK
  • Wolski ZajazdWOLZA
 
Get Selected Item
The ListBox control provides three properties that assist you in retrieving information about the selected item:
  • SelectedIndex - the index of the selected item.
  • SelectedValue - the value of the selected item.
  • SelectedText - the text of the selected item.

You can also loop through the Items collection of the ListBox and check the Selected property of each item. The currently selected item has its Selected property set to true.

"The controls you've created here are definitely the best and easiest to use that I've ever seen or worked with. ;)"

Daniel Burgess

obout.com 
obout.com Home 
News 
Listbox Home   
Listbox Home 
Examples - 49
Appearance - 2 
Live Styles 
Different Styles New 
Load on Demand - 3 
Load Items on Demand 
Load Items on Demand with Paging  
Virtual Scrolling  
Multi-Columns - 4 
Grid-like Multi-Columns  
Multiple Rows and Columns  
Load multi Columns on Demand  
State Selector  
Items with Icons - 3 
Items with Icons  
Grid-like Multi-Columns with Icons  
Multiple Rows and Columns with Icons  
Templates - 3 
Item Templates  
Header Templates  
Populating with Data - 5 
Declarative  
SqlDataSource  
ObjectDataSource  
Generic Collections  
DataSet  
Item Selection - 6 
Single Item Selection  
Multi Item Selection  
Get Selected Item  
Get Selected Items  
Set Selected Item New 
Set Selected Items New 
Master/Detail - 3 
Master/Detail  
Unlimited Detail Levels  
Cascading ListBoxes  
Integration - 4 
Items with ASP.NET CheckBoxes  
Items with Obout CheckBoxes  
RadioButtons inside ListBox  
ListBox inside Grid  
Settings - 3 
AutoPostback  
Height  
Width  
Server-Side API - 4 
Server-Side Events  
Enable / Disable  
Get Values from Multiple Columns New 
Tooltips New 
Client-Side API - 8 
Client-Side Events  
Add / Remove Items  
Add Multi-Column Items New 
Enable / Disable  
Get Selected Item  
Reset Selection New 
Select / Deselect All Items New 
Move Items New 
Appearance Customization - 1 
Aligning Items New 
Knowledge Base - 1 
Knowledge Base 
Documentation - 11 
Server-Side 
ListBox 
ListBoxClientSideEvents 
ComboBoxCssSettings 
ListBoxFooterTemlateContainer 
ListBoxHeaderTemlateContainer 
ListBoxItem 
ListBoxItemEventArgs 
ListBoxItemTemlateContainer 
ListBoxLoadingItemsEventArgs 
Client-Side 
Client-Side API 
ChangeLog 
Tutorials - 2 
Appearance - 1 
CSS Tutorial  
Configuration - 1 
Using the correct path