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

Grid not displaying data in all columns

4 Answers 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
DGraham
Top achievements
Rank 1
DGraham asked on 14 Sep 2016, 01:43 PM

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?

 

 

4 Answers, 1 is accepted

Sort by
0
DGraham
Top achievements
Rank 1
answered on 14 Sep 2016, 01:53 PM
Attached the wrong image to previous post
0
DGraham
Top achievements
Rank 1
answered on 14 Sep 2016, 01:54 PM
Hope this works!
0
DGraham
Top achievements
Rank 1
answered on 14 Sep 2016, 03:49 PM

I'm an idiot!

Descripion = accident.Description,

Yeah, nice spelling of Description!

0
Eyup
Telerik team
answered on 16 Sep 2016, 08:33 AM
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
Tags
Grid
Asked by
DGraham
Top achievements
Rank 1
Answers by
DGraham
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or