- protected void FpSpread1_UpdateCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
- {
- ArrayList arrayList = e.EditValues;
- }
- protected void FpSpread1_DeleteCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
- {
- // ArrayList arrayList = e.EditValues;
- int currentRow = (int)e.CommandArgument;
- string id = e.SheetView.Cells[currentRow,0].Text;
- //id = (string)e.SheetView.Cells[currentRow, 0].Value;
- }
- protected void FpSpread1_InsertCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
- {
- ArrayList arrayList = e.EditValues;
- }
复制代码 上面的已经可以了,可能跟我的的绑定有关系,如下属性:
- FpSpread1.Reset();//复位重置
- FpSpread1.Sheets.Count = 1;//设定表数为 1
- FpSpread1.Sheets[0].AllowInsert = true; //允许 插入
- FpSpread1.Sheets[0].AllowDelete = true; //允许 删除
- FpSpread1.Sheets[0].OperationMode = FarPoint.Web.Spread.OperationMode.RowMode;//行 模式[/color]
复制代码 加载的时候设置这些属性就不会执行Insert Update 不加就可以了。
获取ID 我这里是用隐藏列
- int currentRow = (int)e.CommandArgument;
- string id = e.SheetView.Cells[currentRow,0].Text;
复制代码 这样是可以取到的,问下还有没更好的存ID和取ID的方法?
这个 EditCommand 有什么作用 ?
- protected void FpSpread1_EditCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
- {
- ArrayList arrayList = e.EditValues;
- }
复制代码 |