Combobox + Checkbox+Load on demand+search Item

2 posts, 0 answers
  1. Murugesh
    Murugesh avatar
    7 posts
    Member since:
    Oct 2013

    Posted 18 Nov 2013 Link to this post

    Hello Sir,

    I have the following requirement  to be implemented on my web page. It is similar to MS Excel 2010 Filter. Attached is the sample.

    1. Multiple selection from the Dropdown using checkbox option.
    2. Have to use web service to load the data ( I have approx. 5000 Items )
    3. Autosuggest, while typing system should show the item to be picked.

    I Just purchased the new Telerik License . I hope it will support my requirements

    Thank you


  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 19 Nov 2013 Link to this post

    Hi Murugesh,

    Please have a look into the sample code i tried to achieve your scenario.

    <telerik:RadComboBox runat="server" ID="RadComboBox1" Width="300px" EnableLoadOnDemand="true"
        CheckBoxes="true" OnClientItemsRequesting="OnClientItemsRequesting" Filter="StartsWith">
        <WebServiceSettings Method="GetProducts" Path="Products.asmx" />

    <script type="text/javascript">
        function OnClientItemsRequesting(sender, eventArgs) {
            var context = eventArgs.get_context();
            context["FilterString"] = eventArgs.get_text();

    WebService CS Page(Products.CS):
    public RadComboBoxItemData[] GetProducts(object context)
        IDictionary<string, object> contextDictionary = (IDictionary<string, object>)context;
        SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString);
        string filterString = ((string)contextDictionary["FilterString"]).ToLower();
        SqlCommand selectCommand = new SqlCommand(
        @" SELECT * FROM Customers WHERE (CompanyName) LIKE '" + filterString + "%'", connection);
        SqlDataAdapter adapter = new SqlDataAdapter(selectCommand);
        DataTable products = new DataTable();
        List<RadComboBoxItemData> result = new List<RadComboBoxItemData>(products.Rows.Count);
        foreach (DataRow row in products.Rows)
            RadComboBoxItemData itemData = new RadComboBoxItemData();
            itemData.Text = row["CompanyName"].ToString();
            itemData.Value = row["CompanyName"].ToString();
        return result.ToArray();

Back to Top