This should be easy, but I’m failing to do this. I have ASPxListBox with checkbox option turned on. So I’d like to have selected items in one string. Like this:
item1,item4,item9
and so on.
Notice that they should be divided by “,” and last comma deleted.
Tried something like this, but won’t work:
StringBuilder sb = new StringBuilder();
for (int i = 0; i < lb1.Items.Count; i++)
sb.Append(lb1.Items[i].Selected ? lb1.Items[i].Text + "," : "");
TextBox1.Text = sb.ToString();
(I asked similar question before, but as I havent mention that this is ASPxListBox, suggestions I got wont works.
So, this is Visual Studio 2008, Devexpress 9.3 and .NET framework 3.5
Thanks.
@keyboardP: your solution is rather ok on my mind, so +1.
Moreover, you can find a similar solution in the DevExpress code central:
http://www.devexpress.com/Support/Center/e/E2625.aspx