回复 3楼wjj_123的帖子
你好,可以根据 Cell 的 Note 属性在前台回去相应单元格:
前台代码:
- function Button1_onclick() {
- var spread = this.document.getElementById("FpSpread1");
- var rowcount = spread.GetRowCount();
- var colcount = spread.GetColCount();
- for (var i = 0; i < rowcount; i++) {
- for (var j = 0; j < colcount; j++) {
- var cell = spread.GetCellByRowCol(i, j);
- if (cell.title == null) {
- continue;
- }
- else {
- var cellnote = cell.title;
- if (cellnote == '测试') {
- alert("取得 note 为 “测试” 的 Cell");
- }
- }
-
- }
- }
- }
复制代码
后台代码:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- return;
- FarPoint.Web.Spread.TextCellType textType = new FarPoint.Web.Spread.TextCellType();
- this.FpSpread1.Sheets[0].Cells[0, 0].CellType = textType;
- this.FpSpread1.Sheets[0].Cells[0, 0].Note = "测试";
- }
复制代码 |