문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top