diff --git a/插件库/Lskj.Control/GridControlEx.cs b/插件库/Lskj.Control/GridControlEx.cs index e0f4f4b..a684cb6 100644 --- a/插件库/Lskj.Control/GridControlEx.cs +++ b/插件库/Lskj.Control/GridControlEx.cs @@ -61,6 +61,11 @@ namespace Lskj.Control /// public partial class GridControlEx : UserControl { + /// + /// 说明:缓存计划行 + /// 时间:2024-5-22 + /// + public DataRow jhrowitem = null; /// /// 说明:第一列获取合计 /// 时间:2022-5-7 @@ -5808,7 +5813,15 @@ namespace Lskj.Control this.lblTotal.Text = string.Format(ResourceKeys.GridTotalDisplayText, count, Math.Round(sum, 2), Math.Round(avg, 2), Math.Round(max, 2), Math.Round(min, 2)); if (!string.IsNullOrWhiteSpace(dataFormat)) { - this.lblTotal.Text = string.Format(ResourceKeys.GridTotalDisplayText, count, string.Format("{0:" + dataFormat + "}", Convert.ToDecimal(sum)), string.Format("{0:" + dataFormat + "}", Convert.ToDecimal(avg)), string.Format("{0:" + dataFormat + "}", Convert.ToDecimal(max)), string.Format("{0:" + dataFormat + "}", Convert.ToDecimal(min))); + if (dataFormat.StartsWith("{0:")) + { + this.lblTotal.Text = string.Format(ResourceKeys.GridTotalDisplayText, count, string.Format(dataFormat, Convert.ToDecimal(sum)), string.Format(dataFormat, Convert.ToDecimal(avg)), string.Format(dataFormat, Convert.ToDecimal(max)), string.Format(dataFormat, Convert.ToDecimal(min))); + } + else + { + this.lblTotal.Text = string.Format(ResourceKeys.GridTotalDisplayText, count, string.Format("{0:" + dataFormat + "}", Convert.ToDecimal(sum)), string.Format("{0:" + dataFormat + "}", Convert.ToDecimal(avg)), string.Format("{0:" + dataFormat + "}", Convert.ToDecimal(max)), string.Format("{0:" + dataFormat + "}", Convert.ToDecimal(min))); + } + } } @@ -8327,7 +8340,11 @@ namespace Lskj.Control if (gridColumn.Summary.ActiveCount > 0) { - if (gridColumn.Summary.ActiveCount == 1 && dataRow == null) continue; + if (gridColumn.Summary.ActiveCount == 1 && dataRow == null) + { + jhrowitem = null; + continue; + } GridColumnSummaryItem sumItem = new GridColumnSummaryItem(); if (gridColumn.Summary.ActiveCount == 1) { @@ -8342,4 +8359,4 @@ namespace Lskj.Control //新建汇总 if (dataRow != null) { - \ No newline at end of file + GridColum \ No newline at end of file