Error while binding Kendo ui Grid using Stored Procedure

4 posts, 0 answers
  1. Manikandan
    Manikandan avatar
    1 posts
    Member since:
    Jun 2014

    Posted 03 Jun 2014 Link to this post

    Hi Team,

    I am unable to bind Kendo ui grid from stored procedure using entity framework and I am able to bind kendo ui from table using entity framework.
    PFB Code for bind

    from table:
    return tsmsent.TSMSDets
                  .OrderBy(tsms => tsms.Task)
                  .Select(tsms => new TimeSheetDetails
                  {
                      Task = tsms.Task,
                      Day1 = tsms.Day1,
                      Day2 = tsms.Day2,
                      Day3 = tsms.Day3,
                      Day4 = tsms.Day4,
                      Day5 = tsms.Day5,
                      Day6 = tsms.Day6,
                      Day7 = tsms.Day7
                  }).ToDataSourceResult(request.Take, request.Skip, request.Sort, request.Filter);

    From Stored procedure:
    return tsmsent.GetTimeSheet()
        .OrderBy(tsms => tsms.Task)
        .Select(tsms => new TimeSheetDetails
        {
            Task = tsms.Task,
            Day1 = tsms.Day1,
            Day2 = tsms.Day2,
            Day3 = tsms.Day3,
            Day4 = tsms.Day4,
            Day5 = tsms.Day5,
            Day6 = tsms.Day6,
            Day7 = tsms.Day7
        })
        .AsQueryable().ToDataSourceResult(request.Take, request.Skip, request.Sort, request.Filter);


    kindly help me how to get this done using stored procedure.
    thanks for advance.

    Regards,
    Mani

  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 05 Jun 2014 Link to this post

    Hello Mani,

    I would recommend checking this Code Library project, where similar scenario is illustrated.

    Regards,
    Alexander Popov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. rj
    rj avatar
    1 posts
    Member since:
    Aug 2016

    Posted 09 Sep in reply to Alexander Popov Link to this post

    i am binding kendo grid using ajax way using stored procedure. first time it will display results properly. but when i am clicking on next page or sorting i am getting below error

    Query cannot be enumerated more than once.can you help me

    regards,

  5. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 13 Sep Link to this post

    Hi Rajeshwari,

    In order to have the grid working with paging in AJAX binding you have to follow the approach shown in the following demo. If this grid still fails please verify that applying Skip and Take functions to the IQueryable instance of your model is working.

    Regards,
    Genady Sergeev
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
Back to Top
Kendo UI is VS 2017 Ready