Is there any way to get a list of all items from a RadMultiSelect?
I've found the solution of get it from the datasource, but I'm remodeling exiting code that is replacing RadListBoxes and it would be simpler if I could read the items from RadMultiSelect.Items.
Bernie
1 Answer, 1 is accepted
0
Vasko
Telerik team
answered on 12 Nov 2025, 09:56 AM
Hi Bernie,
You can get a list of all items directly from the RadMultiSelect control on the server side using its Items collection, similar to how you did with RadListBox. The RadMultiSelect exposes an Items property, which contains all MultiSelectItem objects currently loaded in the control.
Here’s how you can access all items from RadMultiSelect in your code-behind:
protectedvoidPage_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
RadMultiSelect1.DataTextField = "textField";
RadMultiSelect1.DataValueField = "valueField";
RadMultiSelect1.DataSource = GetData();
RadMultiSelect1.DataBind();
MultiSelectItemCollection allItems = RadMultiSelect1.Items;
foreach (MultiSelectItem item in allItems)
{
string text = item.Text;
stringvalue = item.Value;
// You can process each item as needed
}
}
}
privateobjectGetData()
{
DataTable dt = new DataTable();
dt.Columns.Add("textField");
dt.Columns.Add("valueField");
for (int i = 0; i < 5; i++)
{
dt.Rows.Add("Item " + i, i);
}
return dt;
}
This approach allows you to read and process all items directly from the RadMultiSelect control, which should help simplify your migration from RadListBox.