回复 1楼raul1122的帖子
问题1:可以通过 sheetview 下属性 ActiveRow 和 ActiveColumn 属性设置。
问题2:可以通过 ComboBoxCellType 下属性 AutoPostBack 设置为 true,通过 FpSpread1_ButtonCommand 事件捕捉。
以上问题测试代码如下:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- return;
- this.FpSpread1.Sheets[0].ActiveColumn= 2;
- this.FpSpread1.Sheets[0].ActiveRow = 1 ;
- string[] cbstr;
- string[] strval;
- cbstr = new String[] { "One", "Two", "Three" };
- strval = new String[] { "1", "2", "3" };
- FarPoint.Web.Spread.ComboBoxCellType cb = new FarPoint.Web.Spread.ComboBoxCellType();
- cb.Items = cbstr;
- cb.ShowButton = true;
- cb.AutoPostBack = true;
- FpSpread1.ActiveSheetView.Columns[0].CellType = cb;
- FpSpread1.ActiveSheetView.DataModel.SetValue(0, 0, 1);
- }
- protected void FpSpread1_ButtonCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
- {
- }
复制代码 |