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

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

3 Answers 45 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jacek
Top achievements
Rank 1
Jacek asked on 16 Nov 2015, 08:54 PM

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

 

3 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 18 Nov 2015, 08:22 AM
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
0
Jacek
Top achievements
Rank 1
answered on 21 Nov 2015, 08:39 PM

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"?

 

0
Magdalena
Telerik team
answered on 23 Nov 2015, 09:33 AM
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
Tags
ComboBox
Asked by
Jacek
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Jacek
Top achievements
Rank 1
Magdalena
Telerik team
Share this question
or