This is a migrated thread and some comments may be shown as answers.

What should I put in Grid to have data bindings?

1 Answer 59 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 2
Michele asked on 31 Jul 2013, 06:33 AM
I'm almost at loading data from the api controller. I've got a controller that returns Json from a IEnumerable<Utenti> (POCO object)

I got this exception

Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1502: The best overloaded method match for 'Kendo.Mvc.UI.Fluent.WidgetFactory.Grid(System.Data.DataTable)' has some invalid arguments

Source Error:

Line 7: <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
Line 8:
Line 9: <% Html.Kendo().Grid(Model)
Line 10: .Name("Grid")
Line 11: .AutoBind(true)

my aspx is

  <% Html.Kendo().Grid(Model) //
    //.Columns(columns =>
    //    columns.Bound(x => x.IDUtente);
    //    columns.Bound(x => x.Nominativo);
    //    columns.Bound(x => x.Societa);
    //    columns.Bound(x => x.Filiale);
    //    columns.Bound(x => x.Ruolo);

    //    //columns.Bound(p => p.).Groupable(false);
    //    //columns.Bound(p => p.ProductName);
    //    //columns.Bound(p => p.UnitPrice);
    //    //columns.Bound(p => p.UnitsInStock);
    .DataSource(dataSource => dataSource
        .Read(read =>
                read.Action("GetListaUtenti", "Administration");

My controller is

         public ActionResult GetListaUtenti([DataSourceRequest] DataSourceRequest request)
         //   if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated) throw new SecurityExeption();

            DataAccessAdministration da = new DataAccessAdministration(Global.IDApplication, IDIstituto);

            int idUser = 185560;
            var res = da.GetListaUtenti(idUser);
            return Json(res);

And the Utente item is of that type

    public class Utente
        public int IDIstituto { get; set; }

        public int IDDipendente { get; set; }

        public string IDUtente { get; set; }

        public string Nominativo { get; set; }

        public string Filiale { get; set; }

        public string Societa { get; set; }

        public string Ruolo { get; set; }

        public string Profilo { get; set; }

        public string Funzioni { get; set; }

        public string Stato { get; set; }

        public int IDStato { get; set; }

        public int IDFunzione { get; set; }

        public int IDProfilo { get; set; }

        public Guid? SFGuid { get; set; }

What should I put in the aspx in order to get data loaded?

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 01 Aug 2013, 04:06 PM
Hello Paolo,

The provided Grid declaration indicates that server binding is used initially (see below) and the datasource configuration indicates that Ajax binding is used subsequently (when paging, sorting, etc).


The current problem is with the server binding. For more information about how to implement it, please refer to:

Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Asked by
Top achievements
Rank 2
Answers by
Telerik team
Share this question