woxptc 你好,可以通过以下方法实现:
前台代码:
- <script type="text/javascript">
- window.onload = function myfunction() {
- var spreadTable = this.document.getElementById("FpSpread1_viewport");
- spreadTable.onmousemove = test;
- }
- function test() {
- var col = event.srcElement.cellIndex;
- var row = event.srcElement.parentElement.rowIndex;
- if ((!isNaN(col)) && (!isNaN(row)) && (0 <= row) && (row < FpSpread1.GetRowCount())) {
- var cell = FpSpread1.GetCellByRowCol(row, col);
- alert(cell.innerText);
- }
- }
- </script>
复制代码 后台代码:- FarPoint.Web.Spread.TextCellType textcell = new FarPoint.Web.Spread.TextCellType();
- textcell.AllowWrap = false;
- textcell.ShowEllipsis = true;
- FpSpread1.Sheets[0].Cells[0, 0].CellType = textcell;
- FpSpread1.Sheets[0].Cells[0, 0].Text = "ddddddddddddddddddddddddddddddddddd";
复制代码 |