Start At Specific Page

4 posts, 0 answers
  1. stevesuk
    stevesuk avatar
    6 posts
    Member since:
    Jan 2007

    Posted 19 Sep 2012 Link to this post

    I have a ListView with a PageSize of 1.as below:-

    @(Html.Kendo().ListView<ResultViewModel>()
                   .Name("detailListView")
                   .TagName("div")
             .DataSource(dataSource =>
             {
                 dataSource.Read(read => read.Action("GetDetails", "Result", new { id = ViewBag.TeamId }));
                 dataSource.PageSize(1);
              })
                .ClientTemplateId("detail-template")
                    .Pageable(pager => pager
                        .Numeric(true)
                        .PreviousNext(true)
                        .Info(true)
                    )                
        )

    How do I set the initial page number to a number other than 1? The datasource JS has a 'page' option but this wrapper doesn't seem to have one.
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 24 Sep 2012 Link to this post

    Hello Steve,

    Currently the dataSource does not expose a method to configure the initial page. As a work-around you could set the AutoBind option to false and request the desired page with the client API.
    e.g.
    <script>
    $(function(){
        $('#youListView').data().kendoListView.dataSource.page(5);
    })
    </script>


    Regards,
    Petur Subev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. stevesuk
    stevesuk avatar
    6 posts
    Member since:
    Jan 2007

    Posted 24 Sep 2012 Link to this post

    Thanls for that.

    Let's hope the method gets exposed in a future release.

    Regards,
    Steve.
  5. Neil
    Neil avatar
    1 posts
    Member since:
    Dec 2012

    Posted 17 Jan 2013 Link to this post

    Hi,

    I've had a good look  & this is the post which matches the problem I am having, only the solution doesn't seem to work for me.

    I am trying to solve the issue whereby  a user can select say page 5 on the paginated listview, then click on one of the results to see further details. When they return  to the list view the page is always set to page 1 again. 

    It looked like the solution above would solve my problem. I turned off AutoBind, I then implemented the function to call the datasource from the client side:

    $('#listView').data().kendoListView.dataSource.page($('#SelectedPage').val());

    However, the List view still loads with the 1st page selected, seems to ignore the page parameter.

    Any insight appreciated.

Back to Top
UI for ASP.NET MVC is VS 2017 Ready