Display List<> data in a column

Apr 1, 2014 at 12:19 AM
Edited Apr 1, 2014 at 12:20 AM
I was wondering if there was a way to display the data from a list in a column? I have the column headers being displayed from a list, but not the data.

This is my current code -
    for (int i = 0; i < Model.ProductTypes.Count; i++)
    {
        columns.Add(a => a.ItemQtyTotal[i]).Titled((string)Model.ProductTypes[i].Name);
    }
Coordinator
Apr 5, 2014 at 8:44 AM
Hi

Try to use this:
for (int i = 0; i < Model.ProductTypes.Count; i++)
    {
        columns.Add().Titled((string)Model.ProductTypes[i].Name).RenderValueAs(p=>p.ProductTypes[i].Value);
    }
Add method expects an expression for filtering and sorting. He can make an a sort for a => a.ItemQtyTotal[i] expression.