Spread for ASP.NET 10 Product Documentation > Client-Side Scripting Reference > Scripting Members > Methods > GetSelectedRange |
Gets the range of cells that are selected on the displayed page.
[JavaScript]
var range = FpSpread1.GetSelectedRange();
None
The returned value is a JavaScript object with the following properties: type, row, column, rowCount, and columnCount. The row and column properties are the indexes of the starting cell in the range. The rowCount and columnCount are the number of rows and columns in the range. The type property, which specifies the type of range, can be one of the following: Cell (if range is a range of cells but not entire row or column), Row (if range is an entire row or multiple rows) or Column (if range is entire column or multiple columns).
This method gets the entire range of selected table cells as a JavaScript object.
This is a sample that contains the method. On the client side, the script that contains the method would look like this:
JavaScript |
Copy Code
|
---|---|
<script type="text/javascript"> function showSelection() { var rg = FpSpread1.GetSelectedRange(); alert("selected "+rg.type+", "+rg.row+", "+rg.col+", "+rg.rowCount+", "+rg.colCount); } </script> |