Selecting multiple values in listbox on runtime
Reply
![]() |
|
|
From:
Pavan Jayavarapu
|
Dear Friends,
I am reading some values from the database, removing delimited(#) characters and storing in an array(splitindustry).
I have set the selected mode of the list box to multiple in the properties.
My Task:
The list box already has some values on page load. I just want to highlight the values present in the splitindustry array onto the list box.
I am able to do the task...but only last value present in the array is getting selected.
I want to highlight all the values present in the array and show the user.
string [] splitindustry = industry.Split(new Char[] {'#', ' '});
foreach (string s in splitindustry) { if (s.Trim() != "") { int iIndex = lstIndustry.Items.IndexOf(new ListItem(s)); if (iIndex != -1) { lstIndustry.SelectedIndex = iIndex; //lstIndustry is the name of the lisybox } } }
Regards, Pavan Kumar
|
|
View other groups in this category.
![]() |
To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings.
Need help? If you've forgotten your password, please go to Passport Member Services.
For other questions or feedback, go to our Contact Us page.
If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list.
Remove my e-mail address from dotNET User Group Hyd.
|
|
- Selecting multiple values in listbox on runtime Pavan Jayavarapu
-