This project is read-only.

how to render a link inside a column

Oct 17, 2014 at 3:06 AM
Edited Oct 17, 2014 at 3:07 AM

First of all, I would like to congrat the people who helped developing this grid library. It is the best grid for mvc i used until now.

I have just one problem with it. I can't render a link as a column content. I tried with this code:
@Html.Grid(Model).Named("arquivosGrid").Columns(columns =>
        columns.Add(x => x.Id).SortInitialDirection(GridMvc.Sorting.GridSortDirection.Ascending);
        columns.Add(x => x.Nome);
        columns.Add(x => x.Usuario.Nome).Titled("Usuário que postou");
        columns.Add().RenderValueAs(x => string.Format("<a href='{0}' class='btn btn-primary btn-sm'>Abrir</a>", x.Caminho)).Encoded(false);
In the browser I get only the text link for the 4th column. The 'a' tag is removed. Did I do something wrong?
Oct 24, 2014 at 1:24 PM
try .Encoded(false).Sanitized(false)