This question is locked. New answers and comments are not allowed.
Hi,
I am new to MVC and MVC using Telerik.
What is difference between
and
I mean Html.Telerik().Grid(Model) and Html.Telerik().Grid<ContactManagement.Models.Contact>()
I have used these two code snippets on a page. The first one generates grid with records, while the other one creates a grid but with no records in it.
Also,
As u can see i have added .Ajax(ajax => ajax.Action("_AjaxBinding", "Contact")) to ajaxify the sorting and paging but that does not happen, becuase following code in controller is never executed.
Can any let me know what am i missing.
Thanks,
Avi
I am new to MVC and MVC using Telerik.
What is difference between
Html.Telerik().Grid(Model) |
.Name("Grid") |
.Columns(colums => |
{ |
colums.Add(o => Html.ActionLink("Edit", "Edit", new { id = o.Id })); |
colums.Add(o => Html.ActionLink("Delete", "Delete", new { id = o.Id })); |
colums.Add(o => o.Id); |
colums.Add(o => o.FirstName); |
colums.Add(o => o.LastName); |
colums.Add(o => o.Phone); |
colums.Add(o => o.Email); |
} |
) |
.Ajax(ajax => ajax.Action("_AjaxBinding", "Contact")) |
.Pageable() |
.Sortable() |
.Scrollable() |
<%= Html.Telerik().Grid<ContactManagement.Models.Contact>() |
.Name("ContactGrid") |
.Columns(colums => |
{ |
colums.Add(o => Html.ActionLink("Edit", "Edit", new { id = o.Id })); |
colums.Add(o => Html.ActionLink("Delete", "Delete", new { id = o.Id })); |
colums.Add(o => o.Id); |
colums.Add(o => o.FirstName); |
colums.Add(o => o.LastName); |
colums.Add(o => o.Phone); |
colums.Add(o => o.Email); |
} |
) |
.Ajax(ajax => ajax.Action("_AjaxBinding", "Contact")) |
.Pageable() |
.Sortable() |
.Scrollable() |
I mean Html.Telerik().Grid(Model) and Html.Telerik().Grid<ContactManagement.Models.Contact>()
I have used these two code snippets on a page. The first one generates grid with records, while the other one creates a grid but with no records in it.
Also,
As u can see i have added .Ajax(ajax => ajax.Action("_AjaxBinding", "Contact")) to ajaxify the sorting and paging but that does not happen, becuase following code in controller is never executed.
[GridAction] |
public ActionResult _AjaxBinding() |
{ |
return View(new GridModel<Contact> |
{ |
Data = _entity.ContactSet.ToList() |
}); |
} |
Can any let me know what am i missing.
Thanks,
Avi