This question is locked. New answers and comments are not allowed.
I have a grid which is loaded from a dynamically built data table with Ajax binding. The Count(), Min() or Max() aggregate functions work ok with this and I see the aggregate data. If I try to use the Sum() or Average() aggregate, then I get an error "No method Sum on type System.Linq.Enumerable is compatible with the supplied arguments."
A simplified code code snippet is shown below. This does not work. However, if I replace Sum with Count, it works perfectly. Also, if I pass a strongly typed model to the grid instead of System.Data.DataRow it works perfectly. The column.DataType concerned is type Decimal.
Any thoughts gratefully accepted...
A simplified code code snippet is shown below. This does not work. However, if I replace Sum with Count, it works perfectly. Also, if I pass a strongly typed model to the grid instead of System.Data.DataRow it works perfectly. The column.DataType concerned is type Decimal.
Any thoughts gratefully accepted...
<%= Html.Telerik().Grid<System.Data.DataRow>() .Name(Model.View + "Grid") .Columns(columns => { foreach (System.Data.DataColumn column in Model.DataSets[0].Data.Columns) { if (column.ColumnName == "Total") columns.Bound(column.DataType, column.ColumnName) .Aggregate(aggregates => aggregates.Sum()) .ClientFooterTemplate("Sum: <#= Sum #>"); else columns.Bound(column.DataType, column.ColumnName); } }) .DataBinding(dataBinding => dataBinding.Ajax() .Select("GetGridData", "AFReport") )%>