views:

704

answers:

2
A: 

Is it possible that the Eval("SLIN") you wrote is supposed to be Eval("CLIN") ? just a thought. Otherwise,i used the same code before and it works.

zaladane
+1  A: 

If it's not just the typo, you could use a subquery on g to build a collection of strongly-typed objects:

var query = from c in dtTaskOrder.AsEnumerable()
            group c by c.Field("CLIN") into g
            select new
            {
                Key = g.Key,
                Count = g.Count(),
                Items = from i in g
                        select new { CLIN = i.Field("CLIN"),
                                     ACRN = i.Field("ACRN"),
                                     Status = i.Field("Status") }
            };
dahlbyk
Thanks dahlbyk. The subquery on g did it. I was able to Eval on the columns because it new about the column names. Thanks again.