控件的两个事件都需要调用这个方法,新增的时候不写CellEditEnded,不然不会生效
ItemsSourceChanged="DetailGrid_ItemsSourceChanged" CellEditEnded="DetailGrid_ItemsSourceChanged"
/// <summary>
/// 列表1合计
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void DetailGrid_ItemsSourceChanged(object sender, EventArgs e)
{
var vm = DataContext as PlateReplaceApplyFormVM;
if (vm == null) return;
CfgSaleOrderReviewItem.ColumnFooterRows.Clear();
var gr = new GroupRow()
{
FontWeight = FontWeights.Bold
};
if (vm.SaleOrderList != null && vm.SaleOrderList.Count > 0) {
CfgSaleOrderReviewItem.ColumnFooters.Rows.Add(gr);
gr["ManagerName"] = "合计";
gr["ProductQuantity"] = vm.SaleOrderList == null ? 0 : vm.SaleOrderList.Sum(p => Convert.ToInt32(p.ProductQuantity));
gr["ProductTotalArea"] = vm.SaleOrderList == null ? 0 : vm.SaleOrderList.Sum(p => Convert.ToDouble(p.ProductTotalArea));
}
}
本站资源均来自互联网,仅供研究学习,禁止违法使用和商用,产生法律纠纷本站概不负责!如果侵犯了您的权益请与我们联系!
转载请注明出处: 免费源码网-免费的源码资源网站 » wpf处理C1FlexGrid 表格合计统计项处理,新增和查询都要生效
发表评论 取消回复