This is a migrated thread and some comments may be shown as answers.

No paging if I set datasource at Page_load

1 Answer 57 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Robert Madrian
Top achievements
Rank 1
Veteran
Iron
Robert Madrian asked on 25 Feb 2011, 06:00 PM
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

 

1 Answer, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 02 Mar 2011, 02:00 PM
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!
Tags
DataPager
Asked by
Robert Madrian
Top achievements
Rank 1
Veteran
Iron
Answers by
Marin
Telerik team
Share this question
or