2015.3.1111.45 broke SelectedIndexChanged event firing after text deleting (+loses hover style)

4 posts, 0 answers
  1. Jacek
    Jacek avatar
    31 posts
    Member since:
    Sep 2011

    Posted 16 Nov 2015 Link to this post

    Hi,

    After installing 2015.3.1111.45 I observed that RadComboBoxes with Filter=Contains setting will not fire after user deletes text and presses enter.

    Scenario:

    RadComboBox populated with data, with settings Filter="Contains".

    When user selects item - event fires. When user deletes entered text and presses ENTER event does not fire.

     Basic markup:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <title></title>
        <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
    </head>
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
             
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //Put your JavaScript code here.
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <div>
            <telerik:RadComboBox Filter="Contains" ID="RadComboBox1" runat="server" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged" AutoPostBack="true" DataSourceID="LinqDataSource1" DataTextField="du" DataValueField="id"></telerik:RadComboBox>
            <asp:LinqDataSource ID="LinqDataSource1" OnSelecting="LinqDataSource1_Selecting" runat="server"></asp:LinqDataSource>
            <asp:Label ID="lblResult" runat="server" Text=""></asp:Label>
        </div>
        </form>
    </body>
    </html>

     

    Sample code with sample data. 

    using System;
    using System.Web.UI.WebControls;
    using System.Linq;
    using Telerik.Web.UI;
    using System.Collections.Generic;
     
    public partial class Default : System.Web.UI.Page
    {
     
        protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e)
        {
            List<int> a = new List<int>();
     
            for(int i = 1; i < 10; i++)
            {
                a.Add(i);
            }
     
            var q = from b in a
                    select new { id = b, du = "2 * " + b.ToString() };
     
            e.Result = q;
        }
     
        protected void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            if (RadComboBox1.Items.Any())
            {
                lblResult.Text = (Int32.Parse(RadComboBox1.SelectedValue)*2).ToString();
            }
        }
    }
     

    Expected behaviour:

     1. User selectes "2 * 2=" and result is shown as 4

    2. User deletes selected text in ComboBox and presses ENTER. ComboBox should return to the first value on list ("2*1=") and show result of "2".

      

    Also with the same build:

    Bootstrap skin loses hover style for combobox list (meaning items on list do not show different background color when mouse is over particular item of this list).

     

    Jacek

     

  2. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 18 Nov 2015 Link to this post

    Hi,

    The new behavior is correct and is a result of a bug fix that we introduced in the latest version. When no EmptyMessage is specified and AllowCustomText is false (as is in your case), if you delete the text of the combo, blurring should return the last saved selection, which is not a change in the selected index and an event shouldn't be raised.

    Regards,
    Bozhidar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jacek
    Jacek avatar
    31 posts
    Member since:
    Sep 2011

    Posted 21 Nov 2015 in reply to Bozhidar Link to this post

    I'm not sure we're talking about the same issue.

    Behavior I expected was introduced at least 2 year ago (it was probably earlier, but that was the time when I found Filter="Contains" property), so I assumed it was a feature, not a bug. Besides, with AllowCustomText=true it is also not working as expected.

    What about missing "hover" style of expanded combobox list for skin "bootstrap"?

     

  5. Magdalena
    Admin
    Magdalena avatar
    421 posts

    Posted 23 Nov 2015 Link to this post

    Hi,

    I confirm that deleting the text inside the input should not raise the SelectedIndexChanged event, since the selection inside the combobox does not change in this instance. 

    Expanded Bootstrap dropdown has no hover effect so we also did not include it in our Bootstrap skin. The only effect is changing the cursor parameter, which can be resolved by setting the "cursor" property to "pointer" to RadComboBox.

    Regards,
    Magdalena
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top