Html encoding column values
Name Surname Marital status Encoded age Not encoded age Birthday Employed
Joe Crosswave Married <span>33</span> 33 1/5/1988 False
Merry Lisel Widowed <span>43</span> 43 5/6/1978
Henry Crux Single <span>30</span> 30 11/19/1990 True
Cody Jurut <span>51</span> 51 8/11/1970 False
Simon Scranton Single <span>35</span> 35 10/10/1985
Leena Laurent Divorced <span>21</span> 21 7/1/2000 False
Ode Cosmides Married <span>55</span> 55 4/17/1966 True
Diandra Mizner Single <span>22</span> 22 8/20/1999 False
Pete Cassel Married <span>24</span> 24 3/13/1997 False
Nicky Tremblay Married <span>33</span> 33 1/5/1988 True
View

@model IQueryable<Person>

@(Html
    .Grid(Model)
    .Build(columns =>
    {
        columns.Add(model => Html.CheckBox("Person_" + model.Id));
        columns.Add(model => "<button data-id=\"" + model.Id + "\">Edit</button>").Encoded(false);

        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("Encoded age").RenderedAs(model => "<span>" + model.Age + "</span>");
        columns.Add(model => model.Age).Titled("Not encoded age").Encoded(false).RenderedAs(model => "<span style='color: #CC4444'>" + model.Age + "</span>");
        columns.Add(model => model.Birthday).Titled("Birthday").Formatted("{0:d}");
        columns.Add(model => model.IsWorking).Titled("Employed");
    })
)