RadButton OnCheckedChanged doesn't PostBack on CheckChange By Space Key

4 posts, 0 answers
  1. Murilo
    Murilo avatar
    17 posts
    Member since:
    Jul 2012

    Posted 26 Jul 2011 Link to this post


    We are using RadButton as CheckBoxes and we catch a problem when trying to check the button with the keyboard, when the user checks it with the space key, only the client-side event fires.

    We tried first this code:
    <telerik:RadButton runat="server" ID="chkIMOPRO" Text="IMO Product" ButtonType="ToggleButton"
                   AutoPostBack="true" ToggleType="CheckBox" OnCheckedChanged="chkIMOPRO_CheckedChanged">
                       <telerik:RadButtonToggleState Selected="true" />
                       <telerik:RadButtonToggleState Selected="false" />

    With that code, everything worked fine, but when one user tried to check it with the keyboard, nothing really happens, we are getting to the server side through RadAjax:
    <telerik:RadAjaxManager runat="server" ID="ajaxManager" OnAjaxRequest="ajaxRequest"
                <telerik:AjaxSetting AjaxControlID="chkIMOPRO" EventName="chkIMOPRO_CheckedChanged">
                        <telerik:AjaxUpdatedControl ControlID="pnlIMOINFO" LoadingPanelID="loadingPanel" />

    And then, we tried the following approach:
    function chkIMOPRO_CheckedChanged(sender, args) {

    <telerik:RadButton runat="server" ID="chkIMOPRO" Text="IMO Product" ButtonType="ToggleButton"
        AutoPostBack="true" ToggleType="CheckBox" OnCheckedChanged="chkIMOPRO_CheckedChanged"
            <telerik:RadButtonToggleState Selected="true" />
            <telerik:RadButtonToggleState Selected="false" />

    And it worked, the client-side event fires in the two cases (by keyboard space and by mouse click).

    We know we can get it to work by activating ajax through javascript, but we think this would be unecessary code.

    Is there any bug or approach related to this issue?

  2. Slav
    Slav avatar
    1359 posts

    Posted 27 Jul 2011 Link to this post

    Hi Murilo,

    Currently RadButton doesn't initiate postback, when it is set as CheckBox, it has AutoPostBack property set to true, and it is checked or unchecked with keyboard 'space' key. Nevertheless, there is still a possible solution that may fulfill your requirement.  You can use RadButton's client side event OnCheckedChanged to programmatically click it and post the page, via the JavaScript method .click().

    You can find attached a sample project, demonstrating the provided solution. Please use it as a basis for your further development.

    In the following link you can check the PITS Issue that I logged for this feature request: Public URL. We will implement it in one of the upcoming releases, although I cannot provide a firm estimate if it will be available in Q2 2011 SP1.
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

    ARNALDO avatar
    1 posts
    Member since:
    Oct 2012

    Posted 24 Mar 2012 Link to this post

    Hi Slav,

    Is there any ETA for this feature? Can you give us a workaround while the feature is not implemented?

    Our customers are asking us everyday about this, thank you :)

    The workaround sent above worked, thanks.
  4. Slav
    Slav avatar
    1359 posts

    Posted 28 Mar 2012 Link to this post

    Hello Arnaldo,

    This feature is not planned for implementing as there are tasks with higher priority. Nevertheless, it will be considered for inclusion if there is enough interest.

    As you have already found out, the desired effect can be achieved with the solution, provided in my last post, so you can use it for the time being.

    All the best,
    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.
Back to Top