No paging if I set datasource at Page_load

2 posts, 0 answers
  1. Robert Madrian
    Robert Madrian avatar
    170 posts
    Member since:
    Apr 2003

    Posted 25 Feb 2011 Link to this post

    If I set the Datasource in the Page_Laod event the paging does'nt work if the page mode is set to slider (see code) - in other modes it works:




    Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load





    If Page.IsPostBack = False Then


    SPCommand = db.GetStoredProcCommand(







    "ReturnValue", DbType.Int32, 0, ParameterDirection.ReturnValue, False, 0, 0, "", DataRowVersion.Default, Nothing)





    "Suchbegriff", DbType.AnsiString, Request("Suchbegriff"))





    Using dataReader As DataSet = db.ExecuteDataSet(SPCommand)



    RadListView1.DataSource = dataReader






    End Using




    End If




    End Sub


  2. Marin
    Marin avatar
    1057 posts

    Posted 02 Mar 2011 Link to this post

    Hi Robert,

    For more complex scenarios when paging is required we recommend advanced databinding for RadListView using the NeedDataSource event, then the ListView will automatically handle the paging. Otherwise you should handle the OnPageIndexChanged event and manually set the correct page index. Both approaches can be found in this online demo. Additionally further information is available in this help article.

    Best wishes,
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top