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

@model IEnumerable<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");
    })
)