I am trying to create a data grid with C# and I will like to implement a cell template.
This is my data grid. My data source, deviceSupportTickets, has the data type of List<SupportTicketVM>. I can't access the current element of the cell to modify it as I will encounter the error
'object' does not contain a definition for 'SupportTicketPrefix' and no accessible extension method 'SupportTicketPrefix' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)
@(Html.DevExtreme().DataGrid<SupportTicketVM>()
.ID("supportTicketDataGrid")
.DataSource(deviceSupportTickets)
.Columns(columns =>
{
columns.AddFor(m => m.SupportTicketPrefix).Caption("Ticket#").CellTemplate(@<text>
<a href="[email protected]">@item.SupportTicketPrefix</a>
</text>);
//More Columns Ommitted
})
.ShowBorders(false)
.ShowColumnLines(false)
.FilterPanel(filterPanel => filterPanel.Visible(false))
.FilterRow(f => f.Visible(false))
.HeaderFilter(f => f.Visible(false))
.GroupPanel(p => p.Visible(false))
.Paging(paging => paging.PageSize(5))
.Pager(pager =>
{
pager.Visible(true);
pager.ShowInfo(true);
pager.ShowNavigationButtons(true);
})
.NoDataText("No ticket created for this device.")
)
Can u try it : I hope it working! good luck