C# Linq Sum from a listObject

we can easily find out the sum from a list of collection. if the list is used in data grid or any other control as a data source we can easily find out the sum of any item field from the list using LINQ.

  var totalQty = ViewData.Requisition.DC_RequisitionItemList.Sum(item => item.ItemTotalValue);  
  ViewData.TotalQty = totalQty;  


Thanks.

Popular posts from this blog

WPF Crystal Report Viewer Using SAP

mvc razor textboxfor change event change another textboxfor value

ASP.NET MVC razor SAP Crystal report