RadCombobox firing SelectedIndexChanged on every postback on IE

16 posts, 0 answers
  1. Thiago
    Thiago avatar
    9 posts
    Member since:
    Dec 2011

    Posted 19 Mar 2013 Link to this post

    Hi there, so, my problem is, I have a RadCombobox that's filled from the codebehind. But depending on what record is selected, it fires the SelectedIndexChanged on every postback.

    After testing EVERY item from my Combobox, I found this:

    My combo has these items:

    1. Foo
    2. Bar
    3. Foo Bar

    If I select 'Foo Bar', I have this issue, and SelectedIndexChanged is fired everywhere.
    This is because the space character that is comming from my database is the character 160(non-breaking space, \u00A0) and not the usual character 32. And according to this blog post(http://www.adamkoch.com/2009/07/25/white-space-and-character-160/), IE handles them diferently.
    If after loading my items, I replace the 160 char for the 32, everything works just fine.

    My question is: Did anybody have this problem? is this a bug? Am I doing something wrong?
  2. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 22 Mar 2013 Link to this post

    Hello Thiago,

    Currently we are not aware of such issue. Could you provide us the implementation of your RadComboBox (statically populated) so we could observe the problem locally?


    All the best,
    Nencho
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Thiago
    Thiago avatar
    9 posts
    Member since:
    Dec 2011

    Posted 25 Mar 2013 Link to this post

    Here's the combobox in the .aspx

    <telerik:RadComboBox ID="RadComboBox1" Culture="pt-BR" runat="server" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged" AutoPostBack="True" />



    And here's it's code in the codebehind

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            RadComboBox1.Items.Add(new RadComboBoxItem("Foo","1"));
            RadComboBox1.Items.Add(new RadComboBoxItem("Bar", "2"));
            RadComboBox1.Items.Add(new RadComboBoxItem("Foo"+((char)160)+"Bar", "3"));
        }
    }
     
    protected void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        //Do Something
    }

    When you select the third item and do a postback, it fires the SelectedIndexChanged event(it fires correctly on selection too)
  5. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 26 Mar 2013 Link to this post

    Hello Thiago,

    I have performed some tests, based on the provided snippet of code, but I am still unable to replicate the described behavior. Here is a video demonstrating it at my end. Would you correct me if I am doing anything wrong? Could you specify the version of our controls that you are using and the browsers under which the behavior occurs?

    Greetings,
    Nencho
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Thiago
    Thiago avatar
    9 posts
    Member since:
    Dec 2011

    Posted 26 Mar 2013 Link to this post

    The problem ONLY occurs on Internet Explorer, i tried with IE8 and 10. 
  7. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 29 Mar 2013 Link to this post

    Hello Thiago,

    Unfortunately, I am still unable to replicate this behavior under both specified browsers. Here is a video demonstrating the tests. Could you please specify which version of our controls do you use?


    Regards,
    Nencho
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  8. Thiago
    Thiago avatar
    9 posts
    Member since:
    Dec 2011

    Posted 01 Apr 2013 Link to this post

    The version is 2012.3.1205.40
  9. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 03 Apr 2013 Link to this post

    Hello Thiago,

    I am still unable to replicate the issue with the specified version. I am sending you the sample project, which I have tested with. Could you please give it a try at your end and let me know if I had missed something?

    Note : dll files are removed from the attachment.

    Regards,
    Nencho
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  10. Thiago
    Thiago avatar
    9 posts
    Member since:
    Dec 2011

    Posted 11 Apr 2013 Link to this post

    I don't know what to tell you, after you sent me this solution, i tried this code in:

    A different project
    The same project but without a master page
    Tha same project WITH a master page
    All of the above but in an user control

    And in all of these tries, the problem didn't occour.
    But when I try it in the user control that it's supposed  to be, this happens.


    What I noticed is that, IE renders the <li> items like this:

    <li>Foo&nbsp;Bar</li>
  11. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 16 Apr 2013 Link to this post

    Hello Thiago,

    I have tried to replicate the issue, placing the RadComboBox in a user control, but I am still unable to replicate the problematic behavior. I am sending you the modified sample. Would you give it a try at your end and let me know if I had missed something.

    Kind regards,
    Nencho
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  12. Thiago
    Thiago avatar
    9 posts
    Member since:
    Dec 2011

    Posted 16 Apr 2013 Link to this post

    That's what i'm trying to tell you.
    I can't reproduce the error either, it happens only when I try it on the pages that the control is supposed to be, NOT in any other place that I can control and show you.

    But here's something interesting: I tried the same thing with the RadDropDownList(the regular asp.net dropdownlist also works) control, and it worked.
  13. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 19 Apr 2013 Link to this post

    Hello Thiago,

    Would you try to create a new page in your application and implement the logic, used in the problematic one? If the issue still persist, I would like to ask you to provide us with a runnable sample, demonstrating the problem.

    Greetings,
    Nencho
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  14. Gregor
    Gregor avatar
    2 posts
    Member since:
    Aug 2008

    Posted 28 Apr 2015 in reply to Nencho Link to this post

    I had the same Problem. I found that in the selected value of my RadCombobox there was a linebreak after the value causing the fireing of the selectedindexchanged Event on every page Action...
  15. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 01 May 2015 Link to this post

    Hello Gregor,

    Could you elaborate a bit more on what exactly was causing the issue at your end. In addition, please provide us with the implementation of the RadComboBox that you use at your end and the underlying data source, which was used for replicating the issue.

    Thus we would be able to replicate the issue locally and determine whether it is a bug.

    Regards,
    Nencho
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  16. Gregor
    Gregor avatar
    2 posts
    Member since:
    Aug 2008

    Posted 04 May 2015 in reply to Nencho Link to this post

    Hello,

    I'm using RadControls for ASP.NET AJAX 2015.1 310.

    In my case the selected Value of the RadComboBox has a linebreak-character (chr(10)+chr(13)) at the ent of the string. when the page did a postback, it also fires the selectedIndexChanged Event of the radcombobox before.

    Kind Regards

    Gregor

  17. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 15 May 2015 Link to this post

    Hello Gregor,

    I am afraid that the issue was not replicated locally, using the last provided information. This is why, I would like to ask you to submit a support ticket, along with a runnable sample attached, so we could inspect your proper implementation and pinpoint the issue.

    Regards,
    Nencho
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017