New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

RadNumericTextBox for RadGrid Footer Totals

You can calculate footer totals client-side having RadNumericTextBoxes in the RadGrid rows and footer. The sums are calculated dynamically with JavaScript wiring the OnFocus and OnBlur events of RadInput. Additionally, for easy extraction of the input values, the code takes advantage of the Client-side API of the RadNumericTextBox and its get_value()/set_value(val) methods.

Keep in mind that the changes made by the user will be lost on subsequent postbacks. If you want to keep the new entries during the page lifecycle, you will need to pass them server-side with custom code logic and refresh the grid source accordingly.

RadGrid totals with RadNumericTextBox

JavaScript
<telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">
  <script type="text/javascript">
    var sumInput = null;
    var tempValue = 0.0;
    function Load(sender, args) {
      sumInput = sender;
    }
    function Blur(sender, args) {
      sumInput.set_value(tempValue + sender.get_value());

    }
    function Focus(sender, args) {
      tempValue = sumInput.get_value() - sender.get_value();
    }
  </script>
</telerik:RadScriptBlock>
Not finding the help you need?
Contact Support