Get selected items text and value from multi combo

1.8k Views Asked by At

My ext.net code for multi combo is as follow:

   <ext:MultiCombo ID="Multi1" runat="server" Width="260">
        <Items>
            <ext:ListItem Text="Item 1" Value="1" />
            <ext:ListItem Text="Item 2" Value="2" />
            <ext:ListItem Text="Item 3" Value="3" />
            <ext:ListItem Text="Item 4" Value="4" />
            <ext:ListItem Text="Item 5" Value="5" />
        </Items>
    </ext:MultiCombo>

How can I get the selected item's text and value from the code behind?

1

There are 1 best solutions below

0
On

You can Try this way

    string values = "";
    foreach (SelectedListItem v in this.Multi1.SelectedItems)
    {
    values += v.Value + " " + v.Text + "</br>";
    }
    X.Msg.Alert("Selected", values).Show();