Spread for ASP.NET 11 Product Documentation
GetRowCount
Spread for ASP.NET 11 Product Documentation > Client-Side Scripting Reference > Scripting Members > Methods > GetRowCount

Gets the number of rows in the displayed page on the client.

Syntax

[JavaScript]

var ret = FpSpread1.GetRowCount();

Parameters

None

Return Type

Integer, number of rows

Remarks

This method returns a count of the rows in the displayed spreadsheet on the client. For a count of the columns, refer to GetColCount.

Example

This is a sample that uses the method to count the rows in order to get a value from each row. On the client side, the script that contains the method would look like this:

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