Spread for ASP.NET 8.0 Product Documentation
Using a Client Scripting Method

Many built-in capabilities are provided in the Spread HTML component (HTC) file, fpspread.htc. The fpspread.htc file implements the client-side functions for the Spread component. It provides a number of properties, methods, and events that can be used in your client-side scripting code in HTML. For a complete list of the contents, refer to the Scripting Members.

Besides using the scripting members, you can also create your own HTC file to implement client-side scripting. Refer to Developing a Custom HTC File.

The following sample code for the ASPX page uses the built-in GetValue method to total the values in the cells (all except the last cell) of the first column and uses the SetValue method to put the result in the last cell of that column.

JavaScript
Copy Code
<SCRIPT language=javascript>
  function doCalc() {
    var rc = FpSpread1.GetRowCount();
    var total = 0;
    for (var i=0; i<rc-1, i++) {
      var value = parseFloat(FpSpread1.GetValue( i, 0 ));
      total += value;
    }
    if (!isNaN(total))
      FpSpread1.SetValue(n-1, 0, total, true);
  }
</SCRIPT>
See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options | Documentation Feedback