回复 2楼guizhi的帖子
这都是通过硬编码实现的,没有设置 id 所有没有改变:
- protected void FpSpread1_UpdateCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
- {
- List<Model.Goods> list = FpSpread1.ActiveSheetView.DataSource as List<Model.Goods>;
- if (e.SheetView.ActiveColumn == 0)
- {
- list[e.SheetView.ActiveRow].Name = e.EditValues[0].ToString();
- list[e.SheetView.ActiveRow].ID = Convert.ToInt32(e.EditValues[0]);
- }
- //
- TreeCellType tree = new TreeCellType();
- tree.list = list;
- FpSpread1.ActiveSheetView.Columns[0].CellType = tree;
- FpSpread1.ActiveSheetView.DataSource = null;
- FpSpread1.ActiveSheetView.DataSource = list;
- }
复制代码 |