ASP.Net Datagrid paging problem

G

Geoerge Zolla

When I connect a web forms datagrid to an access file with paging on, the
numbers show up at the bottom of the grid but they do not allow me to move
forward or back in the table. When I manually add next and back buttons with
code everything works fine. I have the same problem when I turn on the sort
link for each column.



I want a quick way of connecting to a database with navigation number son
the bottom of the grid.



I have tried a number of ways and computers. Please send your response to me
via email.



Thank you in advance.
 
G

George Zolla

I foudn the answer. You ned to fire a mehtod in code to get the paging and
sorting morving. I use dthe following:

Private Sub DataGrid1_PageIndexChanged(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles
DataGrid1.PageIndexChanged

'Create an event handler for the grid's PageIndexChanged event to respond

' to a paging request. Use the e.NewPageIndex to update the DataGrid's

' CurrentPageIndex, then rebind the data. The pages won't change without
this

DataGrid1.CurrentPageIndex = e.NewPageIndex

DataGrid1.DataBind()

End Sub
 

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,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top