Since moving on from .net to .Net Core, Ive had to look for a WebGrid Replacement, which lead me to NonFactors MVC6 grid. I have gotten all the basic understanding of how all if works, now I am trying to understand how to use "@helper" function to display reusable HTML in the table.
Previously in .Net @helper allowed for defining customer HTML then using it in WebGrid, like so The Helper Function and the webgrid Webgrid. Now im currently learning how to do the same functionality in Razor Pages, and im currently at a dead end.
What I would Like to do, is using the MVC6 grid (Grid) with this custom checkbox (HTML)
When using the MVC6 Grid to add column, you could use the
RenderedAs()
andHtml.Raw()
method to add the checkbox. Code like this:Model:
Controller:
View: check the last column.
The output as below:
Reference: MVC6 Grid Formatting
[Note] Before using MVC6 Grid, please make sure you have installed it.