The type arguments for method 'GridHelper.Grid<T>(HtmlHelper, IEnumerable<T>)' cannot be inferred from the usage. error

Viewed 43

I'm getting "The type arguments for method 'GridHelper.Grid(HtmlHelper, IEnumerable)' cannot be inferred from the usage. Try specifying the type arguments explicitly.'" error. How can I fix this?

<div class="row">
    <div class="col-xs-12">
        @(Html.Grid(Model)
            .Name((string)ViewBag.XName+" Visitor List")
            .PKColumn(p => p.ID)
            .Columns(c =>
            {
                c.Add(a => a.Name);
                c.Add(a => a.Surname);
                
            })
            .RowButtons(b =>
            {
                b.Add(GridButtonType.update);
            })

            .ToolbarButtons(b =>
            {
                b.Add(GridButtonType.insert).CssClass("btn btn-primary").Icon("fa-plus").Title("Add Visit").ActionUrl(Url.Action("AddVisit"));
                //b.Add(GridButtonType.insert).CssClass("btn btn-primary").Icon("fa-plus").Title("Visitor Register").ActionUrl(Url.Action("VisitorRegister"));

            })
            .UpdateURL(Url.Action("AddVisit"))
            .DeleteURL("Delete"))

    </div>
</div> 
0 Answers
Related