RadNumericTextBox OnClientValueChanging not firing before PostBack

4 posts, 0 answers
  1. Jon
    Jon avatar
    35 posts
    Member since:
    Sep 2013

    Posted 24 Feb 2014 Link to this post

    I have a RadNumericTextBox in a RadGrid.  I'm using the OnClientValueChanging event to validate the numeric value (I have to do a calculation).  It works great, except when I'm editing in the RadGrid, and I change the value to an undesired value, and I click the Update ImageButton, the OnClientValueChanging event is not raised.  It just posts back and updates the row.

    Any idea how I can raise the OnClientValueChanging event before the Update button posts back?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 24 Feb 2014 in reply to Jon Link to this post

    Hi Jon,

    Please have a look into the sample code snippet which works fine at my end.

    ASPX:
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateEditColumn="true"       DataSourceID="SqlDataSource1">
        <MasterTableView>
            <Columns>
                <telerik:GridTemplateColumn>
                    <EditItemTemplate>
                        <telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" ClientEvents-OnValueChanging="OnValueChanging1">
                        </telerik:RadNumericTextBox>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

    JavaScript:
    <script type="text/javascript">
        function OnValueChanging1(sender, args) {
            alert('fired');
        }
    </script>

    Let me know if you have any concern.
    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jon
    Jon avatar
    35 posts
    Member since:
    Sep 2013

    Posted 25 Feb 2014 in reply to Princy Link to this post

    Thank you for your response.  I don't see an edit column in your example.  The problem I'm having is that the event doesn't fire when the user changes the value, then clicks the Update ImageButton.
  5. Jon
    Jon avatar
    35 posts
    Member since:
    Sep 2013

    Posted 25 Feb 2014 in reply to Jon Link to this post

    OK, I'm no longer able to reproduce this.  I didn't change anything.  I think perhaps it was firing but there was an error in my handler calculations that allowed bad entries under certain conditions???  I hope I don't find the reasoning after it's released to production...

    Sorry to bother y'all on this one.
Back to Top