回复 1楼andy001的帖子
前台获取选中行方法:- <SCRIPT language=javascript>
- function showSelection() {
- var s = document.getElementById("FpSpread1");
- var rgs = s.GetSelectedRanges();
- for (var i=0; i<rgs.length; i++) {
- var rg = rgs[i];
- alert(rg.row+", "+rg.col+", "+rg.rowCount+", "+rg.colCount);
- }
- }
- </SCRIPT>
复制代码
后台获取选中行方法:- FarPoint.Web.Spread.Model.ISheetSelectionModel iss;
- iss = (FarPoint.Web.Spread.Model.ISheetSelectionModel)FpSpread1.ActiveSheetView.SelectionModel;
- iss.SetSelection(0, 0, 2, 2)
- iss.AddSelection(3, 0, 1, 2);
- IEnumerator se;
- bool b;
- FarPoint.Web.Spread.Model.CellRange cr;
- se = sel.GetEnumerator();
- b = se.MoveNext();
- if (b == true)
- {
- cr = (FarPoint.Web.Spread.Model.CellRange)se.Current;
- }
- string msg = "The first column in the selection is " + cr.Column.ToString();
- Response.Write("<script language='javascript'>alert('" + msg + "')</script>");
复制代码
以上均是 Spread 4.0 接口。 |