LLBLGenProDataSource2 Paging

Posts   
 
    
ithank
User
Posts: 3
Joined: 23-Feb-2015
# Posted on: 23-Feb-2015 18:58:25   

We are using the LLBLGenProDataSource2 control tied to an asp.net GridView control. Our form will reload the data displayed in the grid based on a radio button selected by the user. The DataSource control has paging enabled. We are loading a TypeView and binding that programmatically with no issues and paging is working just fine. The only issue we are experiencing is that, when a user has selected, say, page 5 and then selects a different radio button to reload the grid with new data, the DataSource control still 'thinks' it's on page 5. How can I reset the paging to page 1 when rebinding the data source for this control?

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 23-Feb-2015 19:18:51   

How are you binding the datasource programmatically? And how the paging is set?

ithank
User
Posts: 3
Joined: 23-Feb-2015
# Posted on: 23-Feb-2015 19:59:48   

We are using the DataSource's OnPerformSelect event to run code that populates a TypeView using the PerformSelectEventArgs2 to determine/set the sorting, page, and page size when fetching the data. The TypedView is then bound using using DataBind(). The OnPerformGetDbCount event is used to execute a GetDBCount method in the code behind to determine the total number of records which is used to update the PerformGetDbCountEventArg2.DbCount value.

Since the DataSource's EnablePaging property is set to 'True' the page numbers/links are displayed and used to handle the paging by the user.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 24-Feb-2015 00:25:09   

When rebinding the datasource, set the PageIndex property of the GridView to the first page.

ithank
User
Posts: 3
Joined: 23-Feb-2015
# Posted on: 24-Feb-2015 15:27:47   

I had tried that in the interim and was getting a double-tap on the data access method. Found the right location and all is well. Thanks for the assist.