|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Datagrid paging
hie, can someone pls help me with the problem i faced with the datagrid paging ?
the msg error occur when i click on the second page of the datagrid .... the msg error is Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount. my coding is as below : Private Sub DataGrid1_PageIndexChanged(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEvent Args) Handles DataGrid1.PageIndexChanged Dim ds1 As New DataSet Dim da1 As New SqlClient.SqlDataAdapter("select tblmember.username, tblmember.memberphoto_path, tblpayment.aboutme from tblmember, tblpayment where tblmember.paymentid = tblpayment.paymentid AND tblmember.gender = '" & txtgender.Text & "'", conn) da1.Fill(ds1) DataGrid1.CurrentPageIndex = e.NewPageIndex DataGrid1.DataSource = ds1 DataGrid1.DataBind() pls kindly assists me on this problem.... thanks... regards, karenlim |
|
#2
|
||||
|
||||
|
Quote:
Difficult to tell your problem when I cant see the rest of the code, but few things to try: 1. When you initially bind your datagrid, if it is in the page load, make sure you have got it between: Code:
if not page.ispostback then 'bind datagrid end if 2. Try, Code:
DataGrid1.CurrentPageIndex = 0 DataGrid1.databind() when you bind the datagrid initially. 3. Try putting the datagrid's binding all in one procedure, and call it when needed. If no success, just post the rest of your code! Hope this helps! J. ![]() |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Datagrid paging |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|