protected void FpSpread1_ActiveSheetChanged(object sender, EventArgs e) { int index = FpSpread1.ActiveSheetViewIndex; } 复制代码在客户没有提供现成的ActiveSheetViewIndex属性,不过通过以下代码可以取到当前的ActiveSheetViewIndex值:
后台代码
protected override void Render(HtmlTextWriter writer) { WebControl c = FpSpread1.FindControl("viewport") as WebControl; c.Attributes.Add("ActiveSheet", FpSpread1.ActiveSheetViewIndex.ToString()); base.Render(writer); } 复制代码前台代码
<script language="javascript" type="text/javascript"> var ss; function window.onload() { ss = document.getElementById("FpSpread1"); ss.onCallBackStopped = MyFunction; } function MyFunction() { var viewport; viewport = document.getElementById("FpSpread1_viewport"); alert(viewport.getAttribute("ActiveSheet")); } </script> 复制代码