Name | Surname | Marital status | Age | Birthday | Employed |
---|---|---|---|---|---|
Joe | Crosswave | Married | 32 | 1/5/1993 | False |
Merry | Lisel | Widowed | 41 | 5/6/1983 | |
Henry | Crux | Single | 29 | 11/19/1995 | True |
Cody | Jurut | 49 | 8/11/1975 | False | |
Simon | Scranton | Single | 34 | 10/10/1990 | |
Leena | Laurent | Divorced | 19 | 7/1/2005 | False |
Ode | Cosmides | Married | 53 | 4/17/1971 | True |
Diandra | Mizner | Single | 20 | 8/20/2004 | False |
Pete | Cassel | Married | 22 | 3/13/2002 | False |
Nicky | Tremblay | Married | 32 | 1/5/1993 | True |
Mary | Cassel | Married | 24 | 7/10/2000 | True |
Average | 32 |
@model IQueryable<Person>
@(Html
.Grid(Model)
.Build(columns =>
{
columns.Add(model => model.Name).Titled("Name");
columns.Add(model => model.Surname).Titled("Surname");
columns.Add(model => model.MaritalStatus).Titled("Marital status");
columns.Add(model => model.Age).Titled("Age");
columns.Add(model => model.Birthday).Titled("Birthday").Formatted("{0:d}");
columns.Add(model => model.IsWorking).Titled("Employed");
})
.UsingFooter("_GridFooter")
)
@model IGrid<Person>
<tr>
<td colspan="3"><b>Average</b></td>
<td><b>@(Model.Rows.Average(row => row.Model.Age))</b></td>
<td></td>
<td></td>
</tr>