This is a migrated thread and some comments may be shown as answers.

[Solved] Wrong second page in custom paging

3 Answers 172 Views
Grid
This is a migrated thread and some comments may be shown as answers.
max
Top achievements
Rank 1
max asked on 29 Apr 2008, 09:05 AM
The second page on my grid display jusy 1 row..

below a simpe code to reproduct my problem:

aspx:
<telerik:RadGrid ID="RadGrid1" runat="server"  
                 AllowPaging="true"  
                 AllowCustomPaging="true"  
                 PageSize="30"
</telerik:RadGrid> 


vb:
    Protected Sub RadGrid1_NeedDataSource(ByVal source As ObjectByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource 
        Dim startRowIndex As Integer = (RadGrid1.CurrentPageIndex * RadGrid1.PageSize) + 1 
        Dim maximumRows As Integer = RadGrid1.PageSize 
        Dim dt As New System.Data.DataTable 
        dt.Columns.Add(New System.Data.DataColumn("a")) 
        dt.Columns.Add(New System.Data.DataColumn("b")) 
        Dim r As System.Data.DataRow 
        For i As Integer = startRowIndex To startRowIndex + maximumRows 
            r = dt.NewRow() 
            r("a") = "a" + CStr(i) 
            r("b") = "b" + CStr(i) 
            dt.Rows.Add(r) 
        Next 
        RadGrid1.DataSource = dt 
        RadGrid1.VirtualItemCount = 100000 
    End Sub 

Am I doing anything wrong?

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 29 Apr 2008, 01:25 PM
Hello massimo,

The following example demonstrates one possible implementation of custom paging. Please, take a look at it and let me know if this is the expected behavior, or there are additional settings to keep in mind.

Regards,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
max
Top achievements
Rank 1
answered on 29 Apr 2008, 02:05 PM
I was binding 31 instead of 30 rows...just this..
0
Yavor
Telerik team
answered on 29 Apr 2008, 02:29 PM
Hi massimo,

The issue could very well be caused by the object passed as a datasource to the control. In order to further investigate the issue, I would suggest that you open a formal support ticket, and send us a small working project, which would allow me to trace the problem locally. As soon as I do, I will get back to you with my findings.

Greetings,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
max
Top achievements
Rank 1
Answers by
Yavor
Telerik team
max
Top achievements
Rank 1
Share this question
or