Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Datagrid Paging Not Displayinig Correct Page

Reply
Thread Tools

Datagrid Paging Not Displayinig Correct Page

 
 
Chris Lee
Guest
Posts: n/a
 
      09-09-2003
Hello All,

I'm having a problem with datagrid paging. I've got a datagrid with CustomPaging=True.

Here are the symptoms of the problem:

1. When first displaying the data for the datagrid, the first page is displayed no matter what value has been assigned to CurrentPageIndex property.

2. When going to "Page 2", the datagrid still displays data for page 1, but the number 2 is "disabled" in the paging number at the bottom of the datagrid.

3. When going to "Page 3", the datagrid displays data for page 2, but the number 3 is "disabled". After this point, the data that is displayed in the datagrid is always from the previous page index that the user selected.

4. When walking through the code, the values for datagrid.CurrentPageIndex and e.NewPageIndex are correct. Just before the event for the PageIndexChanged has ended, the values of the CurrentPageIndex are correct (despite the wrong data is displayed).

Any help would be greatly appreciated,
Chris

Below are snipets of the code that I'm using

Public Sub MSDReferenceSummary_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEvent Args)
On Error GoTo MSDReferenceSummary_PageIndexChanged_Err

DataGrid_Summ_PageIndexChanged(MSDReference_Summar y_DG, source, e)

MSDReference_Summary_DG.DataBind()

MSDReferenceSummary_PageIndexChanged_Exit:

On Error Resume Next

Exit Sub

MSDReferenceSummary_PageIndexChanged_Err:

Handle_Page_Error("MSDReferenceSummary_PageIndexCh anged Error: " & Err.Description)

Resume MSDReferenceSummary_PageIndexChanged_Exit

End Sub



Public Sub DataGrid_Summ_PageIndexChanged(ByRef dgDataGrid As DataGrid, ByRef source As Object, ByRef e As System.Web.UI.WebControls.DataGridPageChangedEvent Args)

On Error GoTo DataGrid_Summ_PageIndexChanged_Err

Dim objUserInfo As udtUserInfo

Dim objDataGridInfo() As udtDataGridInfo

Dim dsFormData As DataSet

Dim strSQLOrderBy As String

Dim lngDataGridNum As Long

objUserInfo = Session.Item("objUserInfo")

objDataGridInfo = Session.Item("objDataGridInfo")

'Code sniped out, basically code to retrieve the data for the dataset

With objDataGridInfo(lngDataGridNum)

..lngRecordPosition = Record_Page_Position(objUserInfo.intSummaryPageSiz e, CLng(e.NewPageIndex))

..dvDataView = dsFormData.Tables(0).DefaultView

End With

Session.Item("objDataGridInfo") = objDataGridInfo

'This is where the Current Page index is set, and the datasource

'is bound to the datagrid

With dgDataGrid

..CurrentPageIndex = e.NewPageIndex

..DataSource = objDataGridInfo(lngDataGridNum).dvDataView

..DataBind()

End With

Session.Item("objDataGridInfo") = objDataGridInfo

Session.Item("dsFormData") = dsFormData

DataGrid_Summ_PageIndexChanged_Exit:

On Error Resume Next

Exit Sub

DataGrid_Summ_PageIndexChanged_Err:

Handle_Page_Error("DataGrid_Summ_PageIndexChanged Error: " & Err.Description)

Resume DataGrid_Summ_PageIndexChanged_Exit

End Sub

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
simulation result is correct but synthesis result is not correct J.Ram VHDL 7 12-03-2008 01:26 PM
Datagrid paging. It's not changing from page to page. Shapper ASP .Net 2 06-22-2005 02:15 AM
Combining numeric mode paging and nextPreview paging in datagrid Red ASP .Net 1 03-12-2005 11:41 PM
datagrid paging - customising paging style wh1974 ASP .Net 0 01-12-2005 03:48 PM
correct or not correct? Dan HTML 7 10-02-2003 10:16 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57