I'm trying to put a condition on a WebGrid line and the following error occurs: Cannot convert lambda expression to type 'string' because it is not delegate type
EventhoughI'mbasingmyselfonthispost# with credits from MeAjudaSilvio I can not make it work:
grid.Column(Model.DescricaoServico_002, format: (item) =>
{
if (item.Status == 1)
{
return Html.Raw(@<text><div><a href="@Url.Action("ExportarPDFSelecionado", "ProcessamentoRegistros", new { idprocessamentodiario = item.IdProcessamentoDiario, idservico = item.Servico_002.Length > 0 ? item.Servico_002.Substring(item.Servico_002.Length - 3, 3) : item.Servico_002 })" target='_blank'>@(item.Servico_002.Length > 0 ? item.Servico_002.Substring(0, item.Servico_002.Length - 3) : item.Servico_002)</a></div></text>);
}
else
{
return Html.Raw("<font color='red'><b>Inativo</b></font>");
}
}),