Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET VB.NET ListBox
How to get the selected value of a list box that has multiple selection enabled. Just the selected items need to get their values.
Posted 8-Mar-12 7:30am
Edited 11-May-12 10:18am
v2
Comments
SAKryukov at 8-Mar-12 13:46pm
   
What is "ListBob"?
--SA
Member 8317792 at 8-Mar-12 14:00pm
   
List Box **
SAKryukov at 8-Mar-12 18:40pm
   
Hm. Did you notice "Improve question" above?
--SA
Member 8317792 at 11-May-12 16:17pm
   
I do now :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Dude... I also came through certain situation.
But the only change in my case is, it was checklistbox.
 
If I am not wrong, you must facing problem like,
 
On selection of list value you need the current selectedvalue,
but you must be getting the first selected value on every selection change...
 
If this is your problem, I have made a solution for checklistbox on my blog
[http://nadarmuthukumar.blogspot.in/2012/03/get-selected-value-in-checkboxlist_02.html[^]]
You can refer the same, only by changing my checklistbox to listbox
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

The ASP.NET class System.Web.UI.WebControls.ListBox does not support multiple selection in the same way as in WPF or System.Windows.Forms.
 
Please see:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listbox.aspx[^]
 
For multi-select mode, please see:
 
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listbox.selectionmode.aspx[^].
 
Locate the section "Examples" and look for the first example. It shows how to work with multiple selection
 
—SA
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 385
1 Gihan Liyanage 308
2 Sergey Alexandrovich Kryukov 150
3 syed shanu 125
4 ChauhanAjay 120
0 Sergey Alexandrovich Kryukov 9,021
1 OriginalGriff 7,941
2 CPallini 2,603
3 Richard MacCutchan 2,121
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web01 | 2.8.140827.1 | Last Updated 11 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100