It worked yesterday, but not today. I didn't make any changes. Now it always displays "No items to display". I'm getting towards the end of my trial period (got a message when I loaded Visual Studio). Could that have something to do with it?
Here's the grid definition in the view:
@(Html.Kendo().Grid<CapEdit2.Models.Report>()
.Name("SearchResultsGrid")
.DataSource(ds => ds
.Ajax()
.Read(read => read
.Action("GetSearchResults", "Report").Data("reportsReadData")
)
.PageSize(10)
)
.Columns(columns =>
{
columns.Bound(r => r.Id);
columns.Bound(r => r.TransDate).Title("Trans Date").Format("{0:MM-dd-yyyy}");
columns.Bound(r => r.Corporation.Name).Title("Corporation");
columns.Bound(r => r.Headline);
})
.Pageable()
.Sortable()
)
Here's the server-side code that gets the data for the grid (I can see that it's working fine):
public ActionResult GetSearchResults([DataSourceRequest]DataSourceRequest request, string company, DateTime startDate, DateTime endDate)
{
var context = new CapInternalContext();
var query = (IQueryable<Report>)context.Reports
.Include("Corporation")
.Include("Stages");
var result = this.Json(query.ToDataSourceResult(request));
return result; // I put a break point here, and always see results
}
Thanks for your help!
Mike
Here's the grid definition in the view:
@(Html.Kendo().Grid<CapEdit2.Models.Report>()
.Name("SearchResultsGrid")
.DataSource(ds => ds
.Ajax()
.Read(read => read
.Action("GetSearchResults", "Report").Data("reportsReadData")
)
.PageSize(10)
)
.Columns(columns =>
{
columns.Bound(r => r.Id);
columns.Bound(r => r.TransDate).Title("Trans Date").Format("{0:MM-dd-yyyy}");
columns.Bound(r => r.Corporation.Name).Title("Corporation");
columns.Bound(r => r.Headline);
})
.Pageable()
.Sortable()
)
Here's the server-side code that gets the data for the grid (I can see that it's working fine):
public ActionResult GetSearchResults([DataSourceRequest]DataSourceRequest request, string company, DateTime startDate, DateTime endDate)
{
var context = new CapInternalContext();
var query = (IQueryable<Report>)context.Reports
.Include("Corporation")
.Include("Stages");
var result = this.Json(query.ToDataSourceResult(request));
return result; // I put a break point here, and always see results
}
Thanks for your help!
Mike