ListBox - Reorder get all items

2 posts, 0 answers
  1. Kjell
    Kjell avatar
    203 posts
    Member since:
    May 2011

    Posted 01 Nov Link to this post

    How do I get all the items server side in the ListBox as a comma-delimited string without selecting any?
    The visitor will sort the items and then save them sorted ....
  2. Eyup
    Admin
    Eyup avatar
    3012 posts

    Posted 04 Nov Link to this post

    Hi Kjell,

    You can use the common string.Join method to achieve this requirement:
    protected void Button1_Click(object sender, EventArgs e)
    {
        string result = string.Join(", ", RadListBox1.Items.Select(x => x.Text));
        LabelOutput.Text = result;
    }

    I hope this will prove helpful.

    Regards,
    Eyup
    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top