RibbonBarButton OnClick reverts telerik values back to original

3 posts, 0 answers
  1. Richard
    Richard avatar
    28 posts
    Member since:
    Jun 2010

    Posted 26 Sep 2012 Link to this post


    I believe this to be a bug in the ribbon bar (I am on version 2012.2.724.40).  I have a ribbon bar with a RibbonBarButton called "Save" on it.  When the user clicks save, all fields on the current screen are saved to the database.  However, I have found that for telerik fields on the screen (I've reproduced with RadNumericTextBox, RadTextBox, and RadDatePicker, see below code), if the user does not tab off of the field before clicking the ribbon bar button, that the value entered does not save and reverts back to the previous value.  This behavior does not occur if you use a regular asp.net button. My code to reproduce this is below, I have included a radnumerictextbox, raddatepicker, and a regular asp.net textbox.  The regular asp.net textbox always shows correctly, however the telerik ones do not.  If this is indeed a bug, is there a workaround until a fix is available?  I know it seems minor but we have customers who do much data entry, and little things like this can cause big issues.

    The steps to reproduce are:
    1.  Enter a value in the rad numeric textbox, say 50.  Tab off (or at least set focus somewhere else), then click 'save' in the ribbon bar.  The alert message shows '50' as expected.
    2.  Now change the value to '100'.  Do not tab off the numeric textbox, but instead keep focus.  Click 'save' in the ribbon bar.  The alert shows '50' instead of '100', and the value reverts back to '50' in the textbox as well.

    Thank you!

    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    <telerik:RadRibbonBar ID="BaseRibbonBar" runat="server" OnButtonClick="BaseRibbonBar_ButtonClick"
        EnableAjaxSkinRendering="true" Visible="true" Skin="Windows7">
        <telerik:RibbonBarTab Text="Basilisk">
            <telerik:RibbonBarGroup Text="Actions" Value="Actions">
                    <telerik:RibbonBarButton Size="Large" Value="Save" Text="Save" ImageUrlLarge="~/save.png"
                        ImageUrl="~/Images/save.png" ToolTip="Save the current record" />
    <telerik:RadAjaxPanel runat="server" ID="testPanel">
        <telerik:RadNumericTextBox ID="tbMonths" runat="server" Width="40px">
        <telerik:RadDatePicker runat="server" ID="datepicker"></telerik:RadDatePicker>
        <asp:Button runat="server" ID="btnTest" OnClick="btnTest_Click" Text="Save" />
        <asp:TextBox runat="server" ID="Asptest"></asp:TextBox>

    protected void btnTest_Click(object sender, EventArgs e)
        ScriptManager.RegisterStartupScript(this, GetType(), "Test", "alert('result is " + tbMonths.SelectedDate.ToString() + "');", true);
    protected void BaseRibbonBar_ButtonClick(object sender, Telerik.Web.UI.RibbonBarButtonClickEventArgs e)
        ScriptManager.RegisterStartupScript(this, GetType(), "Test", "alert('ribbon result is " + tbMonths.Value.Value.ToString() + "');", true);

  2. Bozhidar
    Bozhidar avatar
    1096 posts

    Posted 27 Sep 2012 Link to this post

    Hi Richard,

    This was indeed a bug in RadRibbonBar, which we fixed in the Q2 2012 SP2 version of the controls ( as stated in the SP2 release notes ). So if you upgrade your controls you shouldn't experience this issue any more.
    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.
  3. Telerik UI for ASP.NET Core is out
  4. Richard
    Richard avatar
    28 posts
    Member since:
    Jun 2010

    Posted 27 Sep 2012 Link to this post

    Thank you Bozhidar, I'm sorry I didn't even realize a new release was out, I was thinking I had the latest.  I should have checked that first.

Back to Top