use dynamic type.
var query = from row in dt.AsEnumerable()
group row by row.Field<dynamic>(0) into grp
select new
{
ItemID = grp.Key,
TotalItems = grp.Sum(r => r.Field<Decimal>(2))
};
Dynmic type is bypass the data type checking so you case dynamically get the results from the above query.
Ref. :
Using Type dynamic[
^]