1. Does the telerik grid fetch all the data in one go and store it in some internal cache from where the data is rendered on every page request?
2. Is the data retrieved from database/ repository on every page request?
Is there a way in which the existing paging mechanism can be modified to implement our custom logic?
5 Answers, 1 is accepted
If you provide the grid with an IQueryable which is capable of executing LINQ expressions in the database level (Entity Framework, Linq to SQL, NHibernate, OpenAccess etc) paging, sorting, filtering and grouping will happen in the database. As a result only a single page of data will be requested by the grid.
You can also implement custom binding as shown here and here.
Atanas Korchev
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
I am are not sure what you mean. Please paste here some code which shows how the grid is configured.
All the best,Atanas Korchev
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
<%: Html.Telerik().Grid<
TelerikMvcApplication23.Models.Product
>()
.Name("Grid")
.DataBinding(dataBinding=> dataBinding.Ajax().Select("Select", "Home"))
.DetailView(detailview => detailview.Template(e =>
{
Html.Telerik().Grid<
TelerikMvcApplication23.Models.Product
>()
.Name("Subgrid")
.DataBinding(databinding => databinding.Ajax().Select("Select", "Home"))
.Columns(column =>
{
column.Bound(p => p.ID);
column.Bound(p => p.Name);
})
.Pageable(pager => pager.PageSize(2))
.Filterable()
.Render();
}))
%>
public class HomeController : AsyncController
{
public ActionResult Index()
{
ViewBag.Message = "Welcome to ASP.NET MVC!";
return View();
}
[GridAction]
public void SelectAsync()
{
}
public ActionResult SelectCompleted()
{
return View(new GridModel(new[] { new Product { ID = 1, Name = "Product 1" } }));
}
}
My query is that I want to bind both the detail and child grid with the async method. However, if i do that, the child grid is not visible on the page.
Your child grids don't have unique ID. You need to use a client-side template so the ID is unique:
.DetailView(detailview => detailview.Template(e =>
{
Html.Telerik().Grid<
TelerikMvcApplication23.Models.Product
>()
.Name("Subgrid
<#= ID #>
")
You may check the associated help topic.
Both master and child grid are bound to the same data. Is this expected? Regards,
Atanas Korchev
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!