-
Notifications
You must be signed in to change notification settings - Fork 137
Open
Description
Hello there. I am migrating a project from an older GridMvc for MVC 4-ish, to .NET Core and GridMvcCore.
The original developer created custom helpers to render the grid in a certain way. They are simple, but the problem is that the CellRenderer and HeaderRenderer properties of IGridColumn don't exist in the newer library.
What is the correct way to migrate these lines that would render the cells and headers for each column? Thank you very much.
@{
void RenderGridBody()
{
if (!Model.ItemsToDisplay.Any())
{
<tr class="grid-empty-text">
<td colspan="@Model.Columns.Count()">
@Model.EmptyGridText
</td>
</tr>
}
else
{
foreach (object item in Model.ItemsToDisplay)
{
<tr class="grid-row @Model.GetRowCssClasses(item)">
@foreach (IGridColumn column in Model.Columns)
{
@column.CellRenderer.Render(column, column.GetCell(item)) <-- offender #1 - CellRenderer
}
</tr>
}
}
}
void RenderGridHeader()
{
<tr>
@foreach (IGridColumn column in Model.Columns)
{
@column.HeaderRenderer.Render(column) <-- offender #2 - HeaderRenderer
}
</tr>
}
}
Metadata
Metadata
Assignees
Labels
No labels