SelectedIndexChanged Does Not Fire

7 posts, 1 answers
  1. Lynn
    Lynn avatar
    186 posts
    Member since:
    Sep 2006

    Posted 18 Oct 2009 Link to this post

    I am encountering a similar problem to the problem description in forum entry
    http://www.telerik.com/community/forums/aspnet-ajax/listbox/selectedindexchanged-does-not-fire.aspx .  This problem (the event not firing) has been tested and is "hard and repeatable".  It occurs when selecting an item that does not show in the first displayed group of items.  For example, I have a listbox with 20 items, but it is only tall enough to show 9 items at a time.  Clicking on any of the nine items displayed when the page first loads correctly causes the SelectedIndexChanged event to fire.  However, clicking on any item in the list that is below the first 9 will not produce the event and the selected item on screen will return to the originally selected item.

    I have seen the code suggested in the above specified forum item which is to be "put on your page", but have no idea where/how to include the code on a web page so that it will run correctly.  I have included this code as javascript on the page, but then receive the following error "Microsoft JScript runtime error: 'Sys' is undefined" and have to ignore the error for the page to continue/complete loading.

    Once the page loads, the listbox still behaves incorrectly per the problem description at the beginning of this entry.  The error "Microsoft JScript runtime error: 'Sys' is undefined" only occurs at page load - which indicates that the javascript does run at page load.  It will also occur if I click on an item displayed in the first 9 items.  It does NOT occur when I click on item 10 or higher.

    This is occurring in "RadControls for ASP.NET AJAX Q2 2009"; Telerik.Web.UI.dll, version 2009.2.701.35; IE 8.0.6001.18828.

    If I run the web page in IE8 in "compatibility mode", the listbox functions correctly.  This is not a satisfactory resolution.

    Thanks in advance for any assistance!

    Lynn

  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 19 Oct 2009 Link to this post

    Hello Lynn,

    This is bug that we have already fixed. I suggest that you upgrade to the latest version of your controls. If you are not able to upgrade, please use the fix provided in the aforementioned forum post. You need to paste the code right after your script manager declaration.

    <asp:ScriptManager runat="server" ID="ScriptManager1">
      </asp:ScriptManager>
     
      <script type="text/javascript">
          function onSelectedIndexChanged(sender, eventArgs) {
              sender._activateItem(eventArgs.get_item());
          }
     
          Sys.Application.add_init(function() {
              Telerik.Web.UI.RadListBox.prototype._onGroupMouseDown = function() { };
          });
       
      </script>


    Regards,
    Genady Sergeev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Lynn
    Lynn avatar
    186 posts
    Member since:
    Sep 2006

    Posted 19 Oct 2009 Link to this post

    Genady,

    Thank you for the reply.  Yes, once I put the script in the correct place, the original problem (event not firing) was corrected.  I will download the latest version and use that.  I wasn't aware that it would resolve this particular problem.

    Thanks!
  4. Drew
    Drew avatar
    13 posts
    Member since:
    Nov 2007

    Posted 27 Oct 2009 Link to this post

    We ran into this issue after we already made a page live.  We are now scrambling to get a fix out.

    What version of the controls contains the fix for this?  We don't want to put the latest development version out there if it has not been fully tested.  
  5. Lynn
    Lynn avatar
    186 posts
    Member since:
    Sep 2006

    Posted 27 Oct 2009 Link to this post

    Drew,

    I have downloaded the latest version available but have not yet tested it myself.  I have a little work to do before I can do that.  The workaround suggested by Genady did work perfectly once I put the script in the correct place and we are still using it in development.

    I know you want a permanent fix (and I agree), but this is quick and did solve my issue.  If you have a production page with this problem, Genady's simple script should resolve it.  See the attached graphic for a more complete view of the implementation of this workaround.

    I'll butt out now and let Telerik confirm the "production version" of the controls that eliminates this problem.

    Lynn

  6. Drew
    Drew avatar
    13 posts
    Member since:
    Nov 2007

    Posted 27 Oct 2009 Link to this post

    The code provided fixed the problem.   Thanks for the response Lynn.

     I am still wondering if there is a production build that fixes the issue.
  7. Answer
    Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 29 Oct 2009 Link to this post

    Hello Drew,

    The official fix is going to be available forth from the Q3 release which is scheduled for the beginning of the next week.

    Greetings,
    Genady Sergeev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top