MayoorPatel
Programmer
I have a multi select listbox on a form which posts to the server and then returns to the form prepoulated with the items it just posted.
I have the following code to populate the dropdown (subcategory) but for some reason it only highlights the first row, when actually ive selected 4 or 5 options.
Can anyone help?
I have the following code to populate the dropdown (subcategory) but for some reason it only highlights the first row, when actually ive selected 4 or 5 options.
Code:
Dim i As Integer
Dim arySelectedSubcategoryItems() As String
If Not Request(subcategory.ID.ToString).Equals(String.Empty) Then
arySelectedSubcategoryItems = Request(subcategory.ID.ToString).ToString().Split(",")
For Each i In arySelectedSubcategoryItems
For Each item As ListItem In subcategory.Items
If Not (i.Equals(String.Empty)) Then
subcategory.Items.FindByValue(i).Selected = True
End If
Next
Next
End If
Can anyone help?