RadComboBox filter uses only first character in IE11

5 posts, 2 answers
  1. Raka
    Raka avatar
    71 posts
    Member since:
    Sep 2011

    Posted 11 Jun 2014 Link to this post

    Hello

    We have a User Control (.Net, c#) that uses RadComboBox with MarkFirstCharacter=true and Filter="Contains".
    When we started typing in the box, it would filter out using the characters as we type them.
    It used to work in IE9 and IE10.  But now with IE11, it has stopped working. 
    It only uses the first character.  We can see that it has found all instances of items that use that character but as soon as we type the second character, it stops filtering.  It works in Compatibility mode and also in Firefox.

    Any ideas?

    Thank you
    Raka
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 11 Jun 2014 in reply to Raka Link to this post

    Hi Raka,

    Please have a look into the sample code snippet which works fine at my end.

    ASCX:
    <telerik:RadComboBox ID="RadComboBox1" AllowCustomText="true" runat="server" Width="300"
        Filter="Contains" MarkFirstMatch="true" Height="200px" DataSourceID="SqlDataSource1"
        DataTextField="ContactName" EmptyMessage="Search for people..." Skin="Office2010Silver">
    </telerik:RadComboBox>

    ASPX:
    <uc1:ComboBox ID="ComboBox1" runat="server" />

    Please provide your full code if it doesn't help.
    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Raka
    Raka avatar
    71 posts
    Member since:
    Sep 2011

    Posted 11 Jun 2014 in reply to Princy Link to this post

    Hello Princy

    Thank you for the quick reply. 
    It does not work when the UserControl containing the RadComboBox is contained inside another control.

    So I have a UserControl1 with
    <%@ Register src="UserControl2.asax" tagname="UserControl2" tagprefix="uc2" %>
    ...
    <uc2:UserControl2 ID="rcbUC" runat="server" DefaultText="Choose one..." Width="250px" DropDownWidth="350px" MaxHeight="150px" IsRequired="true" />
    ...


    UserControl2 has definition like --
                <telerik:RadComboBox runat="server" ID="rcbRadComboBox" MaxHeight="300px" DropDownAutoWidth="Enabled" MarkFirstMatch="true" OnClientFocus="ShowDropDown"
                    Filter="Contains" OnItemDataBound="rcbRadComboBox_ItemDataBound" OnItemsRequested="rcbRadComboBox_ItemsRequested" OnSelectedIndexChanged="rcbRadComboBox_SelectedIndexChanged" />


    This is where I have the problem.  It does not work.
    It may be something related to the UserControl - I don't know.  But it used to work in IE9 and 10.

    Thanks
    Sandhia
  5. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 12 Jun 2014 in reply to Raka Link to this post

    Hi Raka,

    Please try the sample code snippet snippet which works fine at my end. Please provide your full code if it doesn't help.

    ASCX:
    <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="300" EnableLoadOnDemand="true"
        MarkFirstMatch="true" Height="200px" EmptyMessage="Search for people..." Filter="Contains"
        Skin="Office2010Silver" OnItemsRequested="RadComboBox1_ItemsRequested">
    </telerik:RadComboBox>

    ASCX.CS:
    private const int ItemsPerRequest = 10;
    protected void RadComboBox1_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
    {
        DataTable data = GetData(e.Text);
        int itemOffset = e.NumberOfItems;
        int endOffset = Math.Min(itemOffset + ItemsPerRequest, data.Rows.Count);
        e.EndOfItems = endOffset == data.Rows.Count;
        for (int i = itemOffset; i < endOffset; i++)
        {
            RadComboBox1.Items.Add(new RadComboBoxItem(data.Rows[i]["ContactName"].ToString(), data.Rows[i]["ContactName"].ToString()));
        }
    }
    private static DataTable GetData(string text)
    {
        SqlDataAdapter adapter = new SqlDataAdapter("SELECT ContactName from Customers WHERE ContactName LIKE @text + '%'",ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        adapter.SelectCommand.Parameters.AddWithValue("@text", text);
        DataTable data = new DataTable();
        adapter.Fill(data);
        return data;
    }

    Thanks,
    Princy.
  6. Raka
    Raka avatar
    71 posts
    Member since:
    Sep 2011

    Posted 12 Jun 2014 in reply to Princy Link to this post

    Great!  Thank you very much.  I was missing "EnableLoadOnDemand='true'" property.

    Appreciate it much.
    Raka.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017