I am currently evaluating Telerik at the moment and we are currently trying to get our application to use the Grid widget to display a list of "Terms". The grid works semi-nicely when we parse a Model to the partial view and then use the Model with the grid. Model is below;
public class Term
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int TermID { get; set; }
[Required]
public string TermName { get; set; }
public string TermDescription { get; set; }
public bool Preferred { get; set; }
}
The problem is that there can be an unlimited amount of "Terms" so we have tried to use remote binding. However, when we use remote binding, the Grid widget doesn't show up at all. The method in the controller gets the data, and the browser seems to retrieve the json (according to Fiddler).
Controller Method
public ActionResult _TermTable([DataSourceRequest]DataSourceRequest request)
{
using (IVContext db = new IVContext())
{
return Json(db.Terms.ToDataSourceResult(request),JsonRequestBehavior.AllowGet);
}
}
Partial View
@(Html.Kendo().Grid<DemoSpace.Models.Term>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.TermID);
columns.Bound(p => p.TermName);
columns.Bound(p => p.TermDescription);
columns.Bound(p => p.Preferred);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.ServerOperation(true)
.Read(read => read.Action("_TermTable", "Admin"))
)
)
I know that I am going to be missing something obvious, but I just can't see it.
Any and all help is appreciated.