SVN r639
SVN-Revision: r639
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user