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

Some pages loading incorrectly

3 Answers 51 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Mariusz
Top achievements
Rank 1
Mariusz asked on 05 Jul 2011, 12:23 PM
Hello,

we are using RadGridView with RadDataPager and we've met the following problem:

If we switch to the next page using "next page" button or "specific page number" some pages are full, and some contain only a few elements. These "empty" pages are loaded immediately, without calling service for data. However if we move backwards (from the last page), all pages are loaded correctly.

If we do as follows:
1. We start at the first page
2. We move to the second page
3. a) We move to the third page
3. b) We move back to the first page
This is what we get:
1. Full page (in our case 15 elements)
2. Full page, but the first two elements are the same as the last two of the first page
3. a) Only two elements (probably the two from the second page, which were pushed by the two elements from the first page)
3. b) Almost full page, with the last two elements missing...

Obviously, if we move straight (after application starts) to the page 3 for the first time ( skipping second page ), page is loaded properly.
But if we move back to page two, then it contains the 2 elements from page one, page one does not contain those elements any more, and page 4 contains only 4 elements (last elements pushed from pages 2 and 3)

Method returning elements:

public IEnumerable<Invoice> GetCustomerInvoiceList(int customerId, int sellerId)
        {
            (...)
                    return this.ObjectContext.InvoiceSet.Include("InvoiceLine")
                                    .Include("TaxSummaryLine")
                                    .Include("Customer")
                                    .Where(i => i.SellerILN == customer.Gln)
                                    .OrderBy(i => i.Date);
        }

Definition of the pager:

<telerik:RadDataPager Grid.Row="2"
                                  x:Name="InvoicesPager"
                                  Source="{Binding Data, ElementName=CustomerDataSource}"
                                  DisplayMode="All"
                                  PageSize="15"/>

Domain data source code:

<riacontrols:DomainDataSource x:Name="CustomerDataSource"
                                         QueryName="GetCustomerInvoiceList"
                                         AutoLoad="True"
                                         LoadSize="15">
               <riacontrols:DomainDataSource.DomainContext>
                   <context:CustomerDomainContext />
               </riacontrols:DomainDataSource.DomainContext>
               <riacontrols:DomainDataSource.QueryParameters>
                   <riacontrols:Parameter ParameterName="customerId"
                                          Value="{Binding CustomerId}" />
                   <riacontrols:Parameter ParameterName="sellerId"
                                          Value="{Binding SellerId}" />
               </riacontrols:DomainDataSource.QueryParameters>
               <i:Interaction.Triggers>
                   <ei:PropertyChangedTrigger Binding="{Binding RefreshTrigger}">
                       <ei:CallMethodAction MethodName="Clear" />
                       <ei:CallMethodAction MethodName="Load" />
                   </ei:PropertyChangedTrigger>
               </i:Interaction.Triggers>
           </riacontrols:DomainDataSource>

Best regards.

3 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 05 Jul 2011, 01:13 PM
Hi Rafal,

Can you try the following. Replace Telerik RadDataPager with the stock  toolkit DataPager and tell us what happens. Are the results different?

We are looking forward to hearing from you.

Kind regards,

Ross
the Telerik team
Register for the Q2 2011 What’s New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
0
Accepted
Rossen Hristov
Telerik team
answered on 05 Jul 2011, 01:36 PM
Hi Rafal,

I almost forgot. Replace RadGridView with the stock DataGrid. In other words, don't use any Telerik controls and give your project a try. I really doubt that RadDataPager is the culprit, but I might be wrong.

By looking at the code you have pasted, I suspect that the problem is coming from the DomainDataSource and its LoadSize settings. I am not 100% sure though. 

Can you try your project with DataGrid+DataPager+DomainDataSource and tell us whether the behavior is the same?

All the best,
Ross
the Telerik team
Register for the Q2 2011 What’s New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
0
Mariusz
Top achievements
Rank 1
answered on 05 Jul 2011, 02:27 PM
Thanks.
It seems that the problem lays somewhere else on our side. We should have checked it at the very beginning.

Best regards,
RB
Tags
DataPager
Asked by
Mariusz
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Mariusz
Top achievements
Rank 1
Share this question
or