回复 1楼Lonlyju的帖子
请问楼主指的是前台遍历还是后台遍历:
后台遍历方法:
- for (int i = 0; i < this.FpSpread1.Sheets[0].RowCount; i++)
- {
- for (int j = 0; j < this.FpSpread1.Sheets[0].ColumnCount; j++)
- {
- if (this.FpSpread1.Sheets[0].Cells[i, j].Tag != null)
- {
- //
- }
- }
- }
复制代码
前台遍历方法,不过在前台无法拿到 tag 值:
- <script type="text/javascript">
- function getCells() {
- var spread=this.document.getElementById("<%=FpSpread1.ClientID %>");
- 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);
- }
- }
- }
- </script>
复制代码 |