Hello sir/mam
I have radnumeric textboxes with autopostback false on a page .
i want to assign total of two textboxes to third textbox , but the textchange event does not fires.
it fires when autopostback of textbox is set to true and the page gets refresh each time i type in textbox and it also take some time because pageload gets call
please help me to solve this problem.
I have radnumeric textboxes with autopostback false on a page .
i want to assign total of two textboxes to third textbox , but the textchange event does not fires.
it fires when autopostback of textbox is set to true and the page gets refresh each time i type in textbox and it also take some time because pageload gets call
please help me to solve this problem.
4 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 17 Jun 2013, 12:38 PM
Hi,
TextChanged event will fire only when the AutoPostBack property is set to true. So to avoid post-back on TextChanged event, try to do this in client side, you can either use "OnValueChanged" or "OnBlur".
Thanks,
Shinu.
TextChanged event will fire only when the AutoPostBack property is set to true. So to avoid post-back on TextChanged event, try to do this in client side, you can either use "OnValueChanged" or "OnBlur".
Thanks,
Shinu.
0
Kishor
Top achievements
Rank 2
answered on 20 Jun 2013, 12:14 PM
hello this is my code it works fine but it takes time for textchange event to occurI want to assign txtprice * txtquantity to txttotalbut due to autopostback is true it takes time and total is assign after 5 to 7 secondshow can i solve his problemwaiting for reply<asp:UpdatePanel ID ="up" runat ="server" > <ContentTemplate > <telerik:RadNumericTextBox ID="txtprice" AutoPostBack ="true" runat="server" MaxLength ="10" Width ="120px"> <NumberFormat AllowRounding ="false" DecimalDigits = "2" DecimalSeparator ="." GroupSeparator ="," KeepTrailingZerosOnFocus ="true" /> </telerik:RadNumericTextBox> <telerik:RadNumericTextBox ID="txtquantity" AutoPostBack ="true" runat="server" MaxLength ="10" Width ="120px"> <NumberFormat AllowRounding ="false" DecimalDigits = "2" DecimalSeparator ="." GroupSeparator ="," KeepTrailingZerosOnFocus ="true" /> </telerik:RadNumericTextBox> <telerik:RadNumericTextBox ID="txtTotal" AutoPostBack ="true" runat="server" MaxLength ="10" Width ="120px"> <NumberFormat AllowRounding ="false" DecimalDigits = "2" DecimalSeparator ="." GroupSeparator ="," KeepTrailingZerosOnFocus ="true" /> </telerik:RadNumericTextBox> </ContentTemplate> </asp:UpdatePanel> VB CODE Protected Sub txtprice_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtprice.TextChanged txtTotal.Text = (Convert.ToDouble(txtquantity.Text) * Convert.ToDouble(txtprice.Text)) End Sub 0
Hi Sawan,
In this case, you do not need to make a postback to the server. You can easily achieve your requirement by implementing a client side approach:
JavaScript:
Hope this helps. Please give it a try and let me know if it works for you.
Regards,
Eyup
Telerik
In this case, you do not need to make a postback to the server. You can easily achieve your requirement by implementing a client side approach:
<telerik:RadNumericTextBox ID="txtprice"...> <ClientEvents OnValueChanged="valueChanged" /></telerik:RadNumericTextBox><telerik:RadNumericTextBox ID="txtquantity" ...> <ClientEvents OnValueChanged="valueChanged" /></telerik:RadNumericTextBox>function valueChanged(sender, args) { var price = $find("<%= txtprice.ClientID %>").get_value(); var quantity = $find("<%= txtquantity.ClientID %>").get_value(); $find("<%= txtTotal.ClientID %>").set_value(price * quantity);}Hope this helps. Please give it a try and let me know if it works for you.
Regards,
Eyup
Telerik
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 the blog feed now.
0
Kishor
Top achievements
Rank 2
answered on 25 Jun 2013, 11:46 AM
thanks a lot its working fine
