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

[Solved] A bug in the paging?

2 Answers 80 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Joshua
Top achievements
Rank 1
Joshua asked on 04 Sep 2010, 11:13 PM
I'm loading a small set of record - 12 to be exact.

I've included a pager on my grid and I've wired up the sorting event as such:

private void rgvPicks_Sorting(object sender, Telerik.Windows.Controls.GridViewSortingEventArgs e)
{
    rgvPicks.SortDescriptors.Clear();
    Telerik.Windows.Data.SortDescriptor desc = new Telerik.Windows.Data.SortDescriptor();
    string sortMember = e.Column.UniqueName;
    if (sortMember.Equals("Ranking"))
        sortMember = "Score";
    if (string.IsNullOrEmpty(_sortProperty) || !desc.Member.Equals(_sortProperty))
    {
        desc.Member = sortMember;
        desc.SortDirection = System.ComponentModel.ListSortDirection.Ascending;
    }
    else if (_sortProperty == sortMember)
    {
        desc.SortDirection = (_sortDirection == System.ComponentModel.ListSortDirection.Ascending ? System.ComponentModel.ListSortDirection.Descending : System.ComponentModel.ListSortDirection.Ascending);
    }
    _sortProperty = desc.Member;
    _sortDirection = desc.SortDirection;
    rgvPicks.SortDescriptors.Add(desc);
}

In my LinqToEntities call, I've set up a default sort:

public IOrderedQueryable<vw_PicksLeaderboard> GetVw_PicksLeaderboard()
{
    return this.ObjectContext.vw_PicksLeaderboard.OrderByDescending(p => p.Score);
}

I then set the page size to 5.  Therefore, theoretically, I should have 5 records on the first, 5 on the second, 2 on that last as displayed by the following diagram:

First Page - 1, 2, 3, 4, 5
Second Page - 6, 7, 8, 9, 10
Third Page - 11, 12

However, this is what's actually displayed:

First Page - 1, 2, 3, 4, 5  (then click on the second page of the pager)
Second Page - 1, 6, 7, 8, 9 (then, click again on the first page of the page) and what shows up is:

First Page - 2, 3, 4, 5  (that's right, record one is removed from the front page; then click again on the second page):
Second Page - 1, 6, 7, 8, 9

The third page in this case only show's records 10 and 11.  So, record 1 is show on two pages and one record isn't shown at all.

I've also tested this with a page size of 3.

First Page - 1, 2, 3
Second Page - 1, 4, 5
Third Page - 6, 7, 8
Fourth Page - 9, 10, 11

Again, after you click on page 2 and then back on page 1, what shows up is:

First Page - 2, 3

A record again, is missing.

I'm running the latest version of your licensed Silverlight controls.

Please advise. 

2 Answers, 1 is accepted

Sort by
0
Joshua
Top achievements
Rank 1
answered on 04 Sep 2010, 11:18 PM
Also, let me add, that the first column is a user's name.
The second column is their score.

In my case the score for all users is 0.

If the grid is sorted by the user's name, then the paging works fine.  The bug only becomes visible when the sorted values are all the same (i.e. all are zeros).

Thanks, Joshua
0
Rossen Hristov
Telerik team
answered on 06 Sep 2010, 08:28 AM
Hi Joshua,

Could you please open a separate support ticket and attach a sample project that reproduces this behavior. We will debug it and see what is going wrong. Thanks in advance.

Sincerely yours,
Ross
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Joshua
Top achievements
Rank 1
Answers by
Joshua
Top achievements
Rank 1
Rossen Hristov
Telerik team
Share this question
or