Transfer to ListBox2 but only picking up 1 item

5 posts, 1 answers
  1. Martina Long
    Martina Long avatar
    5 posts
    Member since:
    Mar 2010

    Posted 17 Mar 2010 Link to this post

    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 

  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 18 Mar 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Martina Long
    Martina Long avatar
    5 posts
    Member since:
    Mar 2010

    Posted 21 Mar 2010 Link to this post

    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
  5. Martina Long
    Martina Long avatar
    5 posts
    Member since:
    Mar 2010

    Posted 21 Mar 2010 Link to this post

    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
  6. Answer
    Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 23 Mar 2010 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017