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

ListBox - Reorder get all items

1 Answer 68 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Kjell
Top achievements
Rank 1
Iron
Kjell asked on 01 Nov 2016, 10:22 AM
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 ....

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 04 Nov 2016, 08:18 AM
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.
Tags
ListBox
Asked by
Kjell
Top achievements
Rank 1
Iron
Answers by
Eyup
Telerik team
Share this question
or