Question

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?

Was it helpful?

Solution

Solved. I can use this: column.For(x => Html.Partial("MyGridButtons", x)).Named("Action");

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top