SVN-Revision: r639
This commit is contained in:
tdx
2025-05-23 08:01:36 +00:00
parent 3395af1b56
commit b733cfbf02
+23
View File
@@ -8400,6 +8400,29 @@ namespace Lskj.Control
// 更新标题颜色(只花几毫秒)
RefreshHeaderColor();
// ---------- ① 重新计算本行合计 ----------
decimal rowSum = 0m;
foreach (GridColumn col in gridView.Columns)
{
// 只累加日期列
if (!DateTime.TryParse(col.FieldName, out _)) continue;
object valObj = gridView.GetRowCellValue(e.RowHandle, col);
if (valObj != DBNull.Value &&
decimal.TryParse(Convert.ToString(valObj), out decimal amt))
{
rowSum += amt;
}
}
// 把合计写入 “heji” 列(如不存在则自动忽略)
if (gridView.Columns.ColumnByFieldName("workingsum") != null)
{
gridView.SetRowCellValue(e.RowHandle, "workingsum", rowSum);
}
// ---------- ② 更新列标题颜色 ----------
RefreshHeaderColor(); // 若你需要参数,按之前定义调整即可
}
/// <summary>