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

OnClientSelectedIndexChanged Not Firing When Values Changed Via Code

2 Answers 90 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 27 May 2013, 05:48 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 27 May 2013, 06:18 AM
Hi,

Try the following javascript.

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

Thanks,
Princy.
0
James
Top achievements
Rank 1
answered on 27 May 2013, 06:40 AM
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
Tags
ComboBox
Asked by
James
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
James
Top achievements
Rank 1
Share this question
or