I have several comboboxes with checkboxes. I am setting their checked states from server side. The problem is I also want to append a comma at the end. How do I do that? What I've tried:
private
void
RestoreCheckboxCombobox(RadComboBox combobox, List<
int
> selectedIds)
{
List<RadComboBoxItem> selectedItems =
new
List<RadComboBoxItem>(combobox.Items.Count);
StringBuilder sb =
new
StringBuilder(100);
foreach
(RadComboBoxItem itm
in
combobox.Items)
{
if
(selectedIds.Contains(
int
.Parse(itm.Value)))
{
selectedItems.Add(itm);
itm.Checked =
true
;
sb.AppendFormat(
"{0}, "
, itm.Text.Trim());
}
}
if
(sb.Length > 0)
combobox.Text = sb.ToString();
}