Datagrid Next Page Problem

M

Marlene A. Roman

Hello I have a question:

I have a datagrid.
I can make a specific search using some parameters I write and
When a press a command button it calls an sp and returns
the results of a search that is about 25 rows. I show only 13 rows
so I have the "page paging" property to show the navigation buttons
"Previos" and "Next". When I select the Next buttom it always shows me the
same
records for that page from the first search I made. The first page returns
me the records I'm loking for, but the next pages don't return the records
they are supposed
it looks like is not using the DataSet and it has the recors form the first
search
it made. Do I need something aditional to clear the records before doing a
new search so the next pages get updated?

thanks so much
Jenn
 
R

Raterus

Do you have something like this?,

Private Sub myDataGrid_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles myDataGrid.PageIndexChanged
myDataGrid.CurrentPageIndex = e.NewPageIndex
BindData() 'this would be a sub to whatever sub you use to fill the datagrid
End Sub

You need to tell the datagrid to actually move to the next page they clicked on. It seems silly at first, but you'll get used to it.

--Michael
 
M

Marlene A. Roman

I have that function and I use the myDataGrid.CurrentPageIndex =
e.NewPageIndex.

After that Should I call the sp that makes the search again? or get the data
that is stored somewhere?

Thanks a lot. I Hope I get to use it


Do you have something like this?,

Private Sub myDataGrid_PageIndexChanged(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles
myDataGrid.PageIndexChanged
myDataGrid.CurrentPageIndex = e.NewPageIndex
BindData() 'this would be a sub to whatever sub you use to fill the
datagrid
End Sub

You need to tell the datagrid to actually move to the next page they clicked
on. It seems silly at first, but you'll get used to it.

--Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top