具体做法就是
1. 设置单元格格式
FarPoint.Web.Spread.TextCellType txt1 = new FarPoint.Web.Spread.TextCellType();
2. 设置验证方式
RequiredFieldValidator rfv = new RequiredFieldValidator();
rfv.ErrorMessage = "RequiredFieldValidator, from code: value required!";
txt1.Validators.Add(rfv);
3. 给单元格设置单元格格式
FpSpread1.ActiveSheetView.Cells[0, 0].Text = "RequiredFieldValidator, from code";
FpSpread1.ActiveSheetView.Cells[0, 1].CellType = txt1; |