MvcContrib Grid with Razor
-
29-09-2019 - |
Pergunta
I have an intersting question. I'm going to use Razor in my asp.net mvc site. I need to create a grid column with render action. But how can I do it?
Here is the code:
@{
Html.Grid(Model).Columns(column =>
{
column.For(x => x.DeviceId).Named("Action").Action(data => { @* what to place here? *@ });
}
}
I cannot to close the code block with '}' because it just will close the body of inline expression:
column.For(x => x.DeviceId).Named("Action").Action(data => {} @* what to place here? *@ @{}
So, is it possible to solve this problem?
Solução
Solved. I can use this: column.For(x => Html.Partial("MyGridButtons", x)).Named("Action");
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow