RadMultiSelect Get List of Items Server Side

1 Answer 15 Views
Ajax MultiSelect
Bernie
Top achievements
Rank 1
Iron
Iron
Bernie asked on 11 Nov 2025, 04:52 PM

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

Sort by
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: 

<telerik:RadMultiSelect ID="RadMultiSelect1" runat="server" Filter="Contains" Width="400px" Placeholder="Select items..." />
protected void Page_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;
            string value = item.Value;
            // You can process each item as needed
        }
    }
}

private object GetData()
{
    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.

    Regards,
    Vasko
    Progress Telerik

    Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
    Bernie
    Top achievements
    Rank 1
    Iron
    Iron
    commented on 12 Nov 2025, 01:15 PM

    Thank you!

     

    Tags
    Ajax MultiSelect
    Asked by
    Bernie
    Top achievements
    Rank 1
    Iron
    Iron
    Answers by
    Vasko
    Telerik team
    Share this question
    or