Wednesday, April 18, 2012

Investigation: SelectedIndexChanged not firing for DropDownList or RadioButtonList

Issue: SelectedIndexChanged event not firing for a DropDownList or a RadioButtonList, CheckBoxList or any control that is inherited from "ListControl" abstract class.

Following can be the possible reasons:
1. AutoPostBack is not set to true for these controls.
Set this property to true.
2. Script execution is turned off for browser.
SelectedIndexChanged event is dependant on background JavaScript methods. So, if the Javascript is turned off for the browser then this event will not be fired.
So, in this case, either you need to enable javascript for the browser.
Or, if you absolutely cannot enable it (due to strange requirements of your users), you need to place a button besides the dropdown. You do not need to write Click event for this button, as Buttons are postback controls, so and clicking on that will invoke the postback, and that will automatically fireup all SelectedIndexChanged events which were pending since last postback.
3. If you are using Telerik's RadAjaxManager, make sure you are adding the controls properly in RadAjaxManager.
For example,
RadAjaxManager1.AjaxSettings.AddAjaxSetting("rbOptions","rbOptions",null);

No comments:

Post a Comment

Thanks for visiting my blog.
However, if this helped you in any way, please take a moment to write a comment.

Thanks
Nirman

Blog Archive