I have a working server-bound grid. I'm trying to add a server-bound template column based on the following snippet from here.
columns.Bound(p => p.ProductName).Template(@<text>
@if(@item.ProductName != null){
@item.ProductName
} else {
"No data"
}
</text>
);
The ".Template" method generates the error:
Error CS1061 'GridBoundColumnBuilder<MyModel>' does not contain a definition for 'Template' and no accessible extension method 'Template' accepting a first argument of type 'GridBoundColumnBuilder<MyModel>' could be found (are you missing a using directive or an assembly reference?)
These lines are in my _ViewImports.cshtml:
@addTagHelper *, Kendo.Mvc
@using Kendo.Mvc.UI
Using Telerik.UI.for.AspNet.Core 2020.3.915
https://demos.telerik.com/aspnet-mvc/grid/serverrowtemplate
I have not yet found a solution after looking at many links. Am I really missing a using?
(And for the record, the New Thread editor for these forums is shameful. The standard Windows undo/redo/selection do not work in Chrome and poor/lack of formatting options significantly limit what I'm trying to convey.)
Hi,
This could be unrelated, but when I was getting this error I was not properly closing out one of my other blocks of code.
For example, I was attempting to add an .editable popup but did add the ending ). This caused columns to be under an incorrect parent property it was not associated with.
This likely is not your problem, but writing just in case.
Hi Mia,
Thank you for sharing this with the community.
If any further assistance is needed - do not hesitate to contact me and the team.
Kind Regards,
Anton Mironov