No paging if I set datasource at Page_load

2 posts, 0 answers
  1. Robert Madrian
    Robert Madrian avatar
    93 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:


    Protected

     

     

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

     

     

     

     

    If Page.IsPostBack = False Then

     

    SPCommand = db.GetStoredProcCommand(

     

    "SEARCH_NET_Wogehmahin")

     

     

    db.AddParameter(SPCommand,

     

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

     

     

    db.AddInParameter(SPCommand,

     

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

     

     

     

     

    Using dataReader As DataSet = db.ExecuteDataSet(SPCommand)

     

     

    RadListView1.DataSource = dataReader

     

    RadListView1.DataBind()

     

     

     

    End Using

     

     

     

    End If

     

     

     

    End Sub

     

  2. Marin
    Admin
    Marin avatar
    1043 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,
    Marin
    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!
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top