Html encoding column values
Name Surname Marital status Encoded age Not encoded age Birthday Employed
Joe Crosswave Married <span>36</span> 36 1/5/1988 False
Merry Lisel Widowed <span>46</span> 46 5/6/1978
Henry Crux Single <span>34</span> 34 11/19/1990 True
Cody Jurut <span>54</span> 54 8/11/1970 False
Simon Scranton Single <span>39</span> 39 10/10/1985
Leena Laurent Divorced <span>24</span> 24 7/1/2000 False
Ode Cosmides Married <span>58</span> 58 4/17/1966 True
Diandra Mizner Single <span>25</span> 25 8/20/1999 False
Pete Cassel Married <span>27</span> 27 3/13/1997 False
Nicky Tremblay Married <span>36</span> 36 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");
    })
)