Hello,
I was looking at the example provided on:
http://www.4guysfromrolla.com/webtech/072101-1.2.shtml
for paging.
I am using Visual Studio 2003 - Microsoft Development Environment 2003
For paging the page url mentions setting properties to be set as:
AllowPaging="True"
PageSize="15"
OnPageIndexChanged="dgPopularFAQs_Paged">
Ok. I am looking at my datagrid in the design view - there is a Allow
Paging, PageSize - but no OnPageIndexChanged!!
I went to the code behine - at the top selected my datagrid in the top
left drop down menu, and could not find OnPageIndexChanged in the
declarations menu. There is a 'PageIndexChanged' changed - is that it?
Well, I put this code in that area (using a Dataset called ds):
Private Sub dg_PageIndexChanged(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridPageChangedEvent Args) Handles
dg.PageIndexChanged
dg.CurrentPageIndex = e.NewPageIndex
dg.DataBind()
End Sub
The paging numbers show up on the grid, but when I hit any of the
numbers - the same screen shows up - 10 records, it does not advance
(set to 10 in the property builder). It never advances. In my page
load I have this:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not Page.IsPostBack Then
dgDataBind()
End If
End Sub
Any help?
Thanks,
Tmuld