var TatalFeeCollectionDetail = new List<lcclsTotalFeeCollectionDetail>();
TatalFeeCollectionDetail = (from t in .......
group t by new { t.MonthName,t.FeeParticularName }
into grp
select new lcclsTotalFeeCollectionDetail
{
Month = grp.Key.MonthName,
Particular = grp.First().FeeParticularLedgerName,
Amount = grp.Sum(t => t.Amount),
}).ToList();
dgvTotalFeeCollectionDetail.DataSource = TatalFeeCollectionDetail;
我的结果是这样......
Month particular Amount
April b 1
April c 2
April d 1
April e 2
April f 1
我想像这样转换它可以帮助我...........我搜索它但不明白该怎么做......
Month b c d e f Total Amount
April 1 2 1 2 1 7
提前谢谢xxxxxxx