This is a migrated thread and some comments may be shown as answers.

Search Items

2 Answers 139 Views
MultiColumnComboBox
This is a migrated thread and some comments may be shown as answers.
david
Top achievements
Rank 1
david asked on 17 Oct 2019, 08:39 PM

how can we search the items list like a regualar dropdown :

ddl.SelectedIndex = ddl.Items.IndexOf(cbxPractitionerList.Items.FindByValue("X");

2 Answers, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 22 Oct 2019, 12:11 PM

Hello David,

The following code can be used to pre-select an item: 

<telerik:RadMultiColumnComboBox runat="server" ID="RadMultiColumnComboBox1" DataTextField="text" DataValueField="value">
    <Items>
        <telerik:MultiColumnComboBoxItem Text="Item 1" Value="1"></telerik:MultiColumnComboBoxItem>
        <telerik:MultiColumnComboBoxItem Text="Item 2" Value="2"></telerik:MultiColumnComboBoxItem>
        <telerik:MultiColumnComboBoxItem Text="Item 3" Value="3"></telerik:MultiColumnComboBoxItem>
        <telerik:MultiColumnComboBoxItem Text="Item 4" Value="4"></telerik:MultiColumnComboBoxItem>
    </Items>
</telerik:RadMultiColumnComboBox>

using System.Linq;

protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        RadMultiColumnComboBox1.Index = RadMultiColumnComboBox1.Items.ToList()
                                        .IndexOf(RadMultiColumnComboBox1.Items.FindChildByValue("3"));
    }
}

Regards,
Peter Milchev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
david
Top achievements
Rank 1
answered on 22 Oct 2019, 11:09 PM
excellent - thank you
Tags
MultiColumnComboBox
Asked by
david
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
david
Top achievements
Rank 1
Share this question
or