您好,第一个问题原因还在调查,现有的解决方案是前端调用update
- <script lang="javascript" type="text/javascript">
- window.onload = function () {
- var spread1 = document.getElementById("<%=FpSpread1.ClientID %>");
- if (document.all) {
- // IE
- if (spread1.addEventListener) {
- // IE9
- spread1.addEventListener("ActiveCellChanged", cellChanged, false);
- } else {
- // Other versions of IE and IE9 quirks mode (no doctype set)
- spread1.onActiveCellChanged = cellChanged;
- }
- }
- else {
- // Firefox
- spread1.addEventListener("ActiveCellChanged", cellChanged, false);
- }
- function cellChanged(event) {
- spread1.Update();
- }
- }
-
- </script>
复制代码
第二点的还没有好的解决方案,有一个办法是每次重新计算赋值。但是还需要递归向上。我继续看下,先给您个反馈。
- e.SheetView.ColumnHeader.Visible = false;
- e.SheetView.Columns[0].Width = 48;
- if (e.SheetView.RelationName == "Second")
- {
- e.SheetView.Columns[0].Width = 6;
- }
- int total = 0;
- for (int i = 0; i < e.SheetView.RowCount; i++)
- {
- total += (int)e.SheetView.Cells[i, 3].Value;
- e.SheetView.Cells[i, 4].Formula = "D" + (i + 1).ToString() + "*10";
- }
- e.SheetView.Parent.Cells[e.SheetView.ParentRowIndex, 3].Value = total;
复制代码 |