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

RadNumericTextBox OnClientValueChanging not firing before PostBack

3 Answers 102 Views
Input
This is a migrated thread and some comments may be shown as answers.
Gaurab
Top achievements
Rank 1
Gaurab asked on 24 Feb 2014, 11:42 PM
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?

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 25 Feb 2014, 03:59 AM
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.
0
Gaurab
Top achievements
Rank 1
answered on 25 Feb 2014, 03:46 PM
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.
0
Gaurab
Top achievements
Rank 1
answered on 25 Feb 2014, 04:01 PM
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.
Tags
Input
Asked by
Gaurab
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Gaurab
Top achievements
Rank 1
Share this question
or