Using a EditorFor template and trying to create a table, how can I get only one header row instead of one for each item of the collection?
Being the viewmodel
public class CashbackOfferViewModel
{
public List<SingleCashbackOfferViewModel> Offers { get; set; }
}
In the view I have
@Html.DisplayFor(m => m.Offers)
And the display template is
@using LMS.MVC.Infrastructure
@model LMS.MVC.Areas.Finance.Models.SingleCashbackOfferViewModel
<table class="dataGrid">
<thead>
<tr class="headerRow">
<th>@Html.LabelFor(m => m.CampaignName)</th>
<th>@Html.LabelFor(m => m.PersonId)</th>
<th>@Html.LabelFor(m => m.FullName)</ths>
</tr>
</thead>
<tbody>
<tr>
<td>@Html.DisplayFor(m => m.CampaignName)</td>
<td>@Html.DisplayFor(m => m.PersonId)</td>
<td>@Html.DisplayFor(m => m.FullName)</td>
</tr>
</tbody>
</table>