Kendo MVC Grid Filter Expected primaryExpression

If you receive the error:

Expected primaryExpression 

when trying to add a filter to the Kendo MVC grid then you have probably formatted it incorrectly. Try this:  

.DataSource(dataSource => dataSource .Ajax() 
.Filter(filters => filters.Add(trip => trip.DepartureDate).IsGreaterThanOrEqualTo(DateTime.Now.Date).And().IsLessThan(DateTime.Now.Date.AddDays(1))) 
.Model(model => model.Id(p => p.ID)) 
.Read(read => read.Action("GetTrips", "Trip")) )
comments powered by Disqus