This question is locked. New answers and comments are not allowed.
I compared the codes with Telerik sample , everything is the same except the model. But I can't see the records in Grid.
I can change the codes in order to use server binding and it works, but my problem is I can't use Ajax binding.
// Controller
public ActionResult Index()
{
return View();
}
[GridAction]
public ActionResult _Index()
{
return View(new GridModel<AuctionViewModel>
{
Data = GetData()
}
);
}
// If I replace 'Index' Action codes with '_Index' , the server binding works fine and shows the records but when I try to run AjaxBinding , It doesn't works (never runs _Index codes)
// View
@model List<TestMVC3_Telerik.Models.AuctionViewModel>
@{
Html.Telerik().Grid((List<TestMVC3_Telerik.Models.AuctionViewModel>)ViewData["MyAuctions"])
.Name("Grid")
.Columns(columns =>
{
columns.Bound(o => o.AuctionID).Title("ID").Width(100);
columns.Bound(o => o.AuctionName).Title("Name");
})
.DataBinding(dataBinding => dataBinding.Ajax().Select("_Index", "Grid"))
.Pageable(paging => paging.PageSize(5))
.Sortable()
.Scrollable()
.Groupable()
.Filterable();
}
When I run above code an empty grid appears. I can change the codes in order to use server binding and it works, but my problem is I can't use Ajax binding.