Paging problem

tiffany

Well-known member
Joined
Aug 7, 2005
Messages
57
Programming Experience
1-3
Hi it me again. Soory for so many posts, as i'ma newbie so please bear with me. i had did soem codes for the paging in the datagrid. Here is the code in presentation page:

In pageLoad:

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

Dim ds As New DataSet
Dim userID As String
Dim subCat1 As String = lk_subCat.Text
Dim datTime As DateTime
'invoke the method and store in the dataset
ds = bl.displayTopic(userID, subCat1, datTime)
'ds = bl.displayTopic(userID, cate, subCat)
DataGrid1.DataSource = ds
DataGrid1.DataBind()
End Sub

'This is the method to use the paging.
Sub DataGrid1_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles DataGrid1.PageIndexChanged

DataGrid1.CurrentPageIndex = e.NewPageIndex

Dim ds As New DataSet
Dim userID As String
Dim subCat1 As String = lk_subCat.Text
Dim datTime As DateTime
'invoke the method and store in the dataset
ds = bl.displayTopic(userID, subCat1, datTime)
'ds = bl.displayTopic(userID, cate, subCat)
DataGrid1.DataSource = ds
DataGrid1.DataBind()

End Sub

In html page:
OnpageIndexedChange = "DataGrid1_PageIndexChanged"

Of cos i also wrtie some allow paging to true.

But these codes are not allow to retreive the dats from the db and display to the second page of the datagrid.


thankx
tiffany
 

pooh

New member
Joined
Feb 16, 2006
Messages
3
Programming Experience
1-3
hi Tiffany
Have u created the datagrid at runtime? If u have not , there is no need to specify the function name
OnpageIndexedChange = "DataGrid1_PageIndexChanged"
Just code ur pageindex functionality on the "Datagrid"_pageindexchanged function. That is provided to u default.
 
Top Bottom