Spread for ASP.NET 7.0 Product Documentation
GetRowCount
See Also Support Options
Spread for ASP.NET 7.0 Product Documentation > Client-Side Scripting Reference > Scripting Members > Methods > GetRowCount

Glossary Item Box

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 language=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

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.