Grid not displaying data in all columns

5 posts, 0 answers
  1. DGraham
    DGraham avatar
    31 posts
    Member since:
    Sep 2008

    Posted 14 Sep Link to this post

    I have this grid

    @(Html.Kendo().Grid<AccidentBook.Models.Accident>()
          .Name("grid")
          .Columns(columns =>
          {
              columns.Bound(c => c.AccidentDate );
              columns.Bound(c => c.Description);
     
          })
          .DataSource(dataSource => dataSource
              .Ajax()
              .Model(model => model.Id(p => p.ID))
              .Read(read => read.Action("Accidents_Read", "Accident"))
          )
    )

    Here we can see Accidents_Read

    public ActionResult Accidents_Read([DataSourceRequest]DataSourceRequest request)
            {
                IQueryable<Accident> accidents = db.Accidents;
                DataSourceResult result = accidents.ToDataSourceResult(request, accident => new {
                    ID = accident.ID,
                    AccidentDate = accident.AccidentDate,                 
                    Descripion = accident.Description,
                     
                });
     
                return Json(result);
            }

    The issue I am having is that the description column is that the Description column isn't being displayed, AccidentDate is displayed ok. I can see using firebug that the data is being returned ok (attached image). Does anyone have any ideas as to what might be the problem?

     

     

  2. DGraham
    DGraham avatar
    31 posts
    Member since:
    Sep 2008

    Posted 14 Sep Link to this post

    Attached the wrong image to previous post
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. DGraham
    DGraham avatar
    31 posts
    Member since:
    Sep 2008

    Posted 14 Sep in reply to DGraham Link to this post

    Hope this works!
  5. DGraham
    DGraham avatar
    31 posts
    Member since:
    Sep 2008

    Posted 14 Sep Link to this post

    I'm an idiot!

    Descripion = accident.Description,

    Yeah, nice spelling of Description!

  6. Eyup
    Admin
    Eyup avatar
    3009 posts

    Posted 16 Sep Link to this post

    Hello,

    The world of software development is so magical, isn't it? A little hobbit error can mess up the entire system and one missing pebble can cause entire project mountains to crumble.

    It is the developer heroes like you and me, who keep things stable and restore the harmony in the word.

    I'm glad you've found out the cause of the issue and successfully rooted it out.
    Please feel free to turn to us if new questions arise.

    Regards,
    Eyup
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET MVC is VS 2017 Ready