This question is locked. New answers and comments are not allowed.
The problem is then I try to bind a grid to a jscript array as a datasource. It is ok when I don't use paging (as you do in the Twitter example http://demos.telerik.com/aspnet-mvc/grid/externalservicetwitter). But if I apply a "Pageable" attruibute with the page size less then the number of elements in the datasource array, the problem appeared (so, there are should be more then single page).
1. the number of element and page size is not shown in footer (eg. 0-0 of 0 records)
2. navigation buttons looks disabled (next/prior/first/last)
3. paging doesn't work at all even when I point to a page number in URL - I always have a portion oа data from the first page
4. I could control the visible portion of data (if uncomment if-then-else statement in the code below), but I guess it is not the correct solution
5. issues 1&2 disapperars if I point to the page number 2 in the URL string but come again after I click any navigation button
Example code:
controller:
View:
ps: If I change DataBinding event to DataLoad, the problem is still here.
1. the number of element and page size is not shown in footer (eg. 0-0 of 0 records)
2. navigation buttons looks disabled (next/prior/first/last)
3. paging doesn't work at all even when I point to a page number in URL - I always have a portion oа data from the first page
4. I could control the visible portion of data (if uncomment if-then-else statement in the code below), but I guess it is not the correct solution
5. issues 1&2 disapperars if I point to the page number 2 in the URL string but come again after I click any navigation button
Example code:
controller:
public class TicketGridDataSource{ public int Id; public string a,b,c,d,e,f;}View:
<script>function onDataBinding(e) { var grid = $(this).data("tGrid"); var data = new Array({ Id: 1, a:"1", b:"", c:"", d:"", e:""},{ Id: 2, a:"2", b:"", c:"", d:"", e:""},{ Id: 3, a:"31", b:"", c:"", d:"", e:""},{ Id: 4, a:"41", b:"", c:"", d:"", e:""}) //if (e.page == 1) data = $.grep(data, function(item,idx) { return idx < 3 }) //else data = $.grep(data, function(item,idx) { return idx >= 3 }) grid.dataBind(data) }</script>@(Html.Telerik().Grid<TicketGridDataSource>() .Name("ticketsList2") .Columns(columns => { columns.Bound(o => o.a).Title("Author"); }) .Pageable(p => p.PageSize(3)) .ClientEvents(events => events.OnDataBinding("onDataBinding")) .Sortable(s => s.Enabled(false)) )ps: If I change DataBinding event to DataLoad, the problem is still here.