When I use a DataGrid with paging in NumericPages Mode I cannot view any pages past the value of pagebuttoncount + 1. The page will display the next page button group, but if I click any, it will take me back to a page within the first list of pages In this
example I can only see pages 1 - 5 even though there are 10 pages. If I click on ..., I will see ... 6 7 8 9 10 ... but if I click on 7, it will take me to page 3. It is like it is only using the position in the list of page numbers for NewPageIndex, instead
of using the PageIndex that relates to the actual page number. <script runat="server"> Private dsn as String Sub Page_Load() dsn = ConfigurationSettings.AppSettings("DSN") If Not Page.IsPostBack Then End If BindDataGrid() End Sub Sub RequeryGrid(sender As
Object, e As EventArgs) BindDataGrid() End Sub Sub BindDataGrid() Dim sqlGetCompanies As String = "SELECT CompanyID, CompanyName, City FROM Company ORDER BY CompanyName, City" Dim myConnection As New SqlConnection(dsn) Dim myCommand As New SqlCommand(sqlGetCompanies,
myConnection) Dim ds As DataSet = new DataSet() Dim myDataAdapter As New SqlDataAdapter(myCommand) myDataAdapter.Fill(ds) grid.DataSource = ds grid.DataBind() End Sub Sub grid_PageIndexChanged(source As Object, e As DataGridPageChangedEventArgs) grid.CurrentPageIndex
= e.NewPageIndex BindDataGrid() End Sub </script> <form runat="server"> Create a new Company Listing </form>
gonzo
Member
5 Points
1 Post
DataGrid and problem with Paging in NumericPages Mode
Aug 02, 2002 06:30 PM|LINK
Create a new Company Listing </form>
mghaoui
Member
60 Points
12 Posts
Re: DataGrid and problem with Paging in NumericPages Mode
Oct 25, 2003 03:52 PM|LINK
mikepope
Contributor
5803 Points
1156 Posts
Microsoft
Re: DataGrid and problem with Paging in NumericPages Mode
Oct 25, 2003 08:19 PM|LINK