回复 5楼sean03424014的帖子
如果使用的是 comboboxcelltype,该celltype提供了客户端改变接口,代码如下:
后台代码:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- {
- return;
- }
- this.FpSpread1.ActiveSheetView.ColumnCount = 10;
- this.FpSpread1.ActiveSheetView.RowCount = 20;
- this.FpSpread1.ActiveSheetView.PageSize = 30;
- FarPoint.Web.Spread.ComboBoxCellType ctest = new FarPoint.Web.Spread.ComboBoxCellType();
- string[] cbstr;
- cbstr = new String[] { "One", "Two", "Three" };
- ctest.Items = cbstr;
- ctest.OnClientChanged = "getRow();";
- FpSpread1.Sheets[0].Cells[10, 0].CellType = ctest;
- }
复制代码
前台代码:
- <script language="javascript" type="text/javascript">
- function getRow() {
- var activeRow = FpSpread1.GetActiveRow();
- FpSpread1.ScrollTo(activeRow, 0);
- }
- </script>
复制代码 |