|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
paging problem// Private Sub nNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nNext.Click dgTopTen.CurrentPageIndex += 1 dgTopTen.DataBind() End Sub \\ I get this error message here: Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount I have also tried something like this: // Private Sub dgHistory_PageIndexChanged(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles dgHistory.PageIndexChanged dgTopTen.CurrentPageIndex = e.NewPageIndex dgTopTen.DataBind() End Sub \\ With this one my first 5 records are still shown. I am all new to this so I appreciate and thank you for the help in what I am missing. Brad Hi Brad,
In order to page, you need re-bind datagrid's data source: dgTopTen.CurrentPageIndex = e.NewPageIndex dgTopTen.DataSource = GetDataSource ' Get data source from Session or db dgTopTen.DataBind() HTH Elton Wang elton_w***@hotmail.com >-----Original Message----- ByVal e As >Why would this not work? >// >Private Sub nNext_Click(ByVal sender As System.Object, >System.EventArgs) Handles nNext.Click value. It must be >= > dgTopTen.CurrentPageIndex += 1 > dgTopTen.DataBind() >End Sub >\\ > >I get this error message here: Invalid CurrentPageIndex >0 and < the PageCount Object, ByVal e As > >I have also tried something like this: >// >Private Sub dgHistory_PageIndexChanged(ByVal sender As >System.Web.UI.WebControls.DataGridPageChangedEventArgs) the help in what I am Handles >dgHistory.PageIndexChanged >dgTopTen.CurrentPageIndex = e.NewPageIndex >dgTopTen.DataBind() >End Sub >\\ > >With this one my first 5 records are still shown. > >I am all new to this so I appreciate and thank you for Show quoteHide quote >missing. > >Brad > > > >. >
Other interesting topics
New controls in ASP.NET 2.0
input type="file" grabs ENTIRE file path in IE? Tabs in ASP.Net No. of connections available for Per Seat License Layering Images in ASP.Net 1.1 javascript debugging Something like phpMyAdmin but for MSSQL? Disable Cookieless Sessions on Single Page? Installing ASP.NET application on IIS running on port 8080 EXECUTE permission denied on object 'getUniqueCities', database 'd |
|||||||||||||||||||||||