Is RadListView got all the items in the Datasource?

5 posts, 1 answers
  1. Phuc
    Phuc avatar
    3 posts
    Member since:
    Sep 2012

    Posted 21 Sep 2012 Link to this post

    Hello, I wanna ask you a question about paging in RadListView. I saw this demo http://demos.telerik.com/aspnet-ajax/listview/examples/paging/custompaging/defaultcs.aspx and wonder if the radlistview query all the items first then do paging, or just get 10 items after each click?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 Sep 2012 Link to this post

    Hi,

    When custom paging is enabled, RadListView fires its server-side PageIndexChanged event and automatically rebinds after that. You can retrieve the requested page of data for RadListView.In this demo page index is set  as the SelectParameter in SqlDatasource and then corresponding data is fetched in the PageIndexChanged event of RadListview.

    Hope this helps.

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Phuc
    Phuc avatar
    3 posts
    Member since:
    Sep 2012

    Posted 23 Sep 2012 Link to this post

    Thanks for your respond. I'm a new with telerik, can you show me the simple ascx code file and code behind (C#) with all the events, and all the things needed, I just want to know how to apply custom paging in my project.

    My context is : I have a SQL database with 10000 items. I have a function which get 10 items (as List<DataItem>) per invoking (with page index as parameter of this function). I just want to show 10 items in the UI and after clicking the page number, the server will call this function for getting other 10 items.

    Thanks so much, please tell me if you need any information.
  5. Answer
    Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 27 Sep 2012 Link to this post

    Hello Phuc,

    I am attaching a sample project to this message showing how you can perform custom paging when binding RadListView programmatically. You just need to handle NeedDataSource, and set:
    1) The VirtualItemCount property of the control, which should give the total number of items in the listview datasource.
    2) The DataSource property of RadListView. It should contain only the items for the current page. To get them you can use the CurrentPageIndex and PageSize values provided by RadListView.

    Kind regards,
    Tsvetina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Phuc
    Phuc avatar
    3 posts
    Member since:
    Sep 2012

    Posted 27 Sep 2012 Link to this post

    Really thank you to you all, I love your kind of response :)
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017