VB.NET - Selection mode question

Asked By Tara Holmes on 25-Jul-05 03:09 PM
I have a list box with 10 countries to select from. I want the program to ask the user to "select countries" and allow the user to select multiple countires and display them via label. I cannot accomplish this for some reason. I am open for suggestions. Thanks!

List Box works like this

Asked By Aarthi Saravanakumar on 25-Jul-05 03:25 PM
When you have selection mode set to multiple, you can use SelectedItem or selecteValue to access the selected items.
You need to iterate through the items in the list box like this.
foreach(ListItem item in this.ListBox1.Items)
			{
				if(item.Selected==true)
				{
					this.Label1.Text=this.Label1.Text+ "," + item.Value;
				}
			}

Ok now in this case is it client side or server

Asked By Bharath Reddy on 25-Jul-05 04:55 PM
Ok in this case we can implement even on client side as well as server side but client side u got to be very carefull with the indexes.check for the ID and type =select and get the index and value and assign to span.Innerhtml this is one way of doing it otherwise the problem with server is when u do postback how  can u do multiple selection at the same time... uknow what i mean.....

If this is a windows app

Asked By Jon Wojtowicz on 25-Jul-05 05:22 PM
you can use the SelectedItems property. If it is a web app then the previous post is correct on how to access the selected items.
help
multiple items select in a drop down control along with search option Visual Studio .NET 06-Jun-13 is like i may have to use a drop down controls where in is should allow me to select multiple items from a drop down , along with a search option where in a textbox ABC" is should show up all items starting with "abc". thanks sreevani You can not select more than one record in dropdownlist , for that u have to use listbox Use this lb.options[i].text = arrTexts[i]; lb.options[i].value = arrTexts[i]; } } } < / script> <form action = "#"> <select name = mylist id = mylist size = 5> <option value = "Anton"> Anton <option value = "Mike"> Mike <option value = "Peter"> Peter <option value = "Bill"> Bill <option value = "Carl"> Carl < / select> <br> <a href = "javascript:sortlist()"> sort< / a> < / form> Refer this post : http: / / www.eggheadcafe.com community / aspnet / 3 / 10050210 / sorting-by-given-value-in.aspx Hi, select name = "DropDownList1" onchange = "_ _ doPostBack('DropDownList1', '')" language = "javascript" id = "DropDownList1" style = "width:110px;Z-INDEX option> <option value = "Item 8"> Item 8< / option> <option value = "Item 9"> Item 9< / option> < / select> This control is supported with the System.Web.UI.WebControls.DropDownList class, and here is
Could any one help me to get the multi select for drop down in asp.net? DropDown dosnt have any direct property to allow multiple item selection here is one Dropdown Mulitselect control check this: http: / / www.codeproject.com RepeatDirection = "Vertical" RepeatColumns = "1" BorderWidth = "0" Datafield = "description" DataValueField = "value"> <asp:ListItem id = "text1" Value = "Select me 1" onclick = "changeColor(this);"> < / asp:ListItem> <asp:ListItem id = "text2" Value = "Select me 2" onclick = "changeColor(this);"> < / asp:ListItem> <asp:ListItem id = "text3" Value = "Select me 3
Does a dropdownlist control allow multi selection? If not, what can I use to allow a user to multi select data that is returned from the database? Thanks, Ninel Use a ListBox control with AllowMultiSelect a webpage you will have to use ASP and JavaScript. The code for the multiple select dropdown can be found at http: / / www.codeproject.com / asp / multiselectdropdown.asp You may have
05 AM Please let me know if any one is having idea on to have multi select options in drop down list Dropdown doesn't allow multiSelection But there are some other way for it 1. Custom dropdownList control http: / / www Other third-party dropdownControl: http: / / easylistbox.com / demoMultiDropdown.aspx The Windows.Forms.ComboBox cannot provide multi-selection. Follow these links her you will get some other alternative- http: / / www.codeproject.com codeproject.com / KB / aspnet / MutiSelectComboBox.aspx hi, In dropdown multiple selection is not possible, ListBoxes allow you to set properties that allow multiple selections, but ComboBoxes do not One, MultiSimple, or MultiExtended. If set to MultiSimple, you can select or deselect multiple items with a mouse click. If set to MultiExtended, you can select groups of adjacent items with a mouse. (Does not apply to ComboBox.) or you can
NET 06-Jun-13 10:29 AM Is this possible? I need to create a multi-select DataGrid, and I canot use CheckBoxes. I want the selected rows to appear highlighted. One that occurred to me was to devise my code in such a way as to allow the user to click anywhere in a DataGrid row, which would the CheckBox for that a CheckBox by Clicking Anywhere in DataGrid Is this possible I need to create a multi-select DataGrid, and I canot use CheckBoxes. I want the sel
for redness, swelling, pain ect. Hello, Following steps resolved your query easily. Open word document. Select Visual Basic from View > > Toolbars. You will see a VB tool bar.and a Control activate). Use it as required. Place the cursor in the form where you want the multi-selection list and then go to the Controls Task Pane (View > Design Tasks > Controls). Under the Repeating and Optional section, click Multiple-Selection List Box. Configure the multi-select list box as you would a standard List Box. If you want to give users the ability to enter their own values, be sure to select Allow users to enter custom values. FYI To specify the control properties, do the following: In a single-selection list box, click Single. To create a multiple-selection list box, click Multi. To create an extended-selection list box, click Extend. Thank you fot your quick reply the combo box and list content controls. The one tool offered by Word that does allow multiple selection is the list box control that you can put on a userform (a
06-Jun-13 10:07 AM Hello All, I want to develop small webapplication that allow me to select multiple files from fileUpload control and get full path of files and add into ListBox questions: http: / / stackoverflow.com / questions / 97198 / webdev-what-is-the-best-way-to-do-a-multi-file-upload http: / / stackoverflow.com / questions / 97198 / webdev-what-is-the-best-way-to-do-a-multi-file-upload http: / / stackoverflow.com / questions / 582126 / best-way-to-upload-multiple-files-from-a upload all the files or more than one file in one click. Asp.net does allow you to upload file one by one.As far as I know, usually we use FireFox only the file name is retrievable, because of security reason. File upload does't allow to select multiple file at a time. But you have to implement the functionality or have to file selection from file selection popup. Hello All, I want to develop small webapplication that allow me to select multiple files from fileUplo
10:02 AM Hello I have a requirement of adding the checkbox's to a multi-select list box control. That i am doing using below line xnMain.SelectSingleNode(" / pr:properties / p but when i uncheck it in preview mode, it get hidden / disappers. I want to allow user to make a selection on checkbox's added using managed code. Any help in list box-infopath2010 Hello I have a requirement of adding the checkbox's to a multi-select list box co
Hi, In my application, user select files to open and that file list i populate in the listview. Now in OpenFileDialogBox we can select Multiple files using Shift Key as well as using control key. if we select files from 1 to 10 using shift key , the FileName array in openfiledialogbox return me the sequence of file like this 10, 9, 8, 7. . . . . . 2, 1 . and if i select 1 , 3 , 4, 7, 9 files using control key the filenames i get as it OK Then Dim fileName As String() = openFileDialog1.FileNames End If End Sub Even when you allow multi select, you don't need control or shift key. thank you Hi, its default behaviour of have files in order like 1, 2, 3, 4, 5, 6, 7, 8 if you select 1 to 4 using shift or control, the files array will be 4, 1, 2