Hello,
I want to create a html helper for grid in asp.net core application using code from this example Define a custom Html.Kendo extension helper.
But HtmlHelper class not found. What am I doing wrong?
7 Answers, 1 is accepted
You could try to replace the HtmlHelper with the interface IHtmlHelper:
Hope this helps.
Regards,
Konstantin Dikov
Telerik by Progress

Hello Konstantin,
Thank you for your help.
I want to create a custom grid with GridFilterMode.Row, and set each column filter operator display text and "NO DATA FOUND" message. I have not found a way to change them, can you help me?
The requirement that you have should be available out of the box and you could check our online demo for the Row filtering:
If you have something different in mind, please provide additional information about the requirement.
Regards,
Konstantin Dikov
Telerik by Progress

Hi I'm currently trying to implment this, but I'm getting an error: 'IHtmlHelper' does not contain a definition for 'Kendo' and no extension method 'Kendo' accepting a first argument of type 'IHtmlHelper' could be found. Any help would be appreciated.
Here is my Extensions file:
using
Kendo.Mvc.UI;
using
Microsoft.AspNetCore.Mvc.Rendering;
namespace
MantleMapperDotNet.WebCore.Helpers
{
public
static
class
HtmlExtensions
{
public
static
Kendo.Mvc.UI.Fluent.GridBuilder<T> MyGrid<T>(
this
IHtmlHelper helper,
string
name)
where T :
class
{
return
helper.Kendo().Grid<T>();
}
}
}
You could try to use the GridBuilder instead:
using Kendo.Mvc.Examples.Models;
using Kendo.Mvc.Extensions;
using Kendo.Mvc.UI;
using Kendo.Mvc.UI.Fluent;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
namespace MyNamespace
{
public static class MyHtmlHelperExtensions
{
public static GridBuilder<
T
> MyKendoGrid<
T
>(this GridBuilder<
T
> helper, string name)
where T : class
{
return helper
.Name(name)
.Groupable()
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
.Pageable();
}
}
}
Hope this helps.
Regards,
Konstantin Dikov
Progress Telerik

Currently migrating this project from .NET MVC 5.2.7 to .Net Core 3.1 and in that proces i'm having trouble to get this extension fixed.
It is the exact same problem as Luke describes. The Kendo() method is not available on the IHtmlHelpers. I don;t know why, as far as ai can see all usings are in place. The suggestions from Constantin is different, it extends the GridBuidler, not the IHhtmlHelper. So all views have to change, while the method should be available to the IHhtmlHelper object.
Anything changed since 2018? Or other suggestions?

public
static
GridBuilder<T> MyKendoGrid<T>(
this
IHtmlHelper<dynamic> helper) where T :
class
using <dynamic> works but the extension method is not accessible from views? how to fix that?
public static class GridExtensions
{
public static GridBuilder<TModel> ExtendedGrid<TModel>(this GridBuilder<TModel> builder) where TModel : class
{
// your code
}
}
@using MyApp.Extensions;
@(Html.Kendo().Grid<ViewModel>()
.ExtendedGrid()
.Name("ExampleGrid");