OnClientSelectedIndexChanged Not Firing When Values Changed Via Code

3 posts, 1 answers
  1. James
    James avatar
    55 posts
    Member since:
    Oct 2011

    Posted 27 May 2013 Link to this post

    Hi All,

    Here is my senario with my RadComboBox:

    1. My RCB has thee items: Item A, Item B, and Item C.
    2. I first select Item B.
    3. The OnClientSelectedIndexChanged fires.
    4. I use JS to change my RCB back to Item A, using the .set_text("Item A") method.
    5. I then change back to Item B.
    6. My event does not fire.

    I reason that my event does not fire because the RCB "thinks" it has *not* changed, sense it was changed back to Item B only via code.

    Any suggestions?

    Thanks!

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

    Posted 27 May 2013 Link to this post

    Hi,

    Try the following javascript.

    JS:
    function OnClientSelectedIndexChanged(sender, args)
      {
          sender.clearSelection(); //clear selection before setting new text
          sender.set_text("item1");
      }

    Thanks,
    Princy.
  3. James
    James avatar
    55 posts
    Member since:
    Oct 2011

    Posted 27 May 2013 Link to this post

    Yikes, now that I'm thinking about it, that was a dumb question.  :)  As always, thanks for the help.  I have some work coming your way.

    Jim
Back to Top