This is a migrated thread and some comments may be shown as answers.

Transfer to ListBox2 but only picking up 1 item

4 Answers 59 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Martina Long
Top achievements
Rank 1
Martina Long asked on 17 Mar 2010, 05:55 AM
I have two listboxes and have it all setup and working so that the user can move items from the first listbox to the second list box.

Once they have finished and they click submit I want to build a string of each item now in Listbox 2 but for some reason it is only picking up the first item?

This is the code I am using to try and get the items in Listbox 2:

Dim inputValue As String = "" 
        For Each item As RadListBoxItem In rlbOptionsReOrder.Items 
            inputValue += item.Value & "," 
        Next 

4 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 18 Mar 2010, 09:19 AM
Hi Martina Long,

You cannot upload files from upload that is inside AjaxPanel. More information as well as a workaround for this problem can be found in this help article.

Regards,
Genady Sergeev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Martina Long
Top achievements
Rank 1
answered on 22 Mar 2010, 03:49 AM
I am not sure what you mean? I am not trying to upload any files? I am trying to save the values that are in ListBox2 to my database

The idea is that the items are in list box 1 a user can reorder them into listbox 2 and then I need to save the valuse in listbox2 to my database so I can see what order the user put them into
0
Martina Long
Top achievements
Rank 1
answered on 22 Mar 2010, 03:50 AM
I am using the ListBox controls.

It is sending the first item in the second listbox to the DB but it doesn't seem to be getting the rest?

even if I do a Items.Count it says only 1 even though there are 4 items in ListBox2
0
Accepted
Genady Sergeev
Telerik team
answered on 23 Mar 2010, 05:01 PM
Hello Martina Long,

Something must have gone wrong with the posts since my previous replay was for other support thread.

Regarding your question, the Items.Count property should return the correct number of items in the listbox, we are not aware of any problems with that functionality. Can you provide us with more details regarding your scenario, perhaps some sample code & markup. I have tried the following code and it seems to work:


Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim sb As StringBuilder = New StringBuilder()
 
        For Each item As RadListBoxItem In RadListBox2.Items
            sb.Append(item.Value)
        Next
 
        Dim result As String = sb.ToString()
 
        Response.Write(result.ToString())
 
    End Sub


Best wishes,
Genady Sergeev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ListBox
Asked by
Martina Long
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Martina Long
Top achievements
Rank 1
Share this question
or