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

Grid Pager Range Reversed

1 Answer 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 09 Mar 2011, 04:45 PM
I'm using a RadGrid within a RadTab, within a RadWindow.  My local RadGrid attributes are:
<rad:RadGrid runat="server" id="memberGrid" 
                OnNeedDataSource="MemberGridNeedDataSource" 
                OnItemCreated="MemberGridItemCreated"
                OnItemDataBound="MemberGridItemDataBound"   
                ShowHeader="true" BorderWidth="0"  >
                <MasterTableView PageSize="3" >
                    <Columns>
                             ...
                    </Columns>                    
                </MasterTableView>
            </rad:RadGrid>
My global RadGrid skin attributes are:
<rad:RadGrid
    runat="server"
    ImagesPath="~/App_Themes/mySkin/Grid"
    Skin="mySkin"
    EnableEmbeddedSkins="false"
    AutoGenerateColumns="false"
    ShowFooter="true"
    AllowPaging="true" 
    PageSize="25"
    AllowSorting="true"
    Width="100%">
    <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
    </rad:RadGrid>

And my OnNeedDataSource function simply resets the DataSource of the grid:
protected void MemberGridNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            memberGrid.DataSource = Members; // Generic List
        }

I've added 5 items dynamically to the grid, in order each named "First", "Second", "Third", "Forth", "Fifth".  I add these items to a list using Members.InsertAt(0, new CustomListItem("First")).  The "InsertAt(0,...)" forces the next item added to the list to appear in the first row in the grid when rebound.  The issue I'm noticing is when paging, the RadGrid displays the wrong end of the list on the next page.  In the screen shot, I would expect to see, in order, "Second" and "First" on page 2 (screenshot fig b.), but instead it displays "Fifth", "Forth"...which is already being displayed when viewing page 1 (screenshot fig a.).  I've inspected the data source and all items do exist (screenshot fig c.). 

Any ideas on why the range that the RadGrid is selecting to view on the next page is not correctly aligned with the datasource?

Thanks,
Patrick

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 15 Mar 2011, 08:26 AM
Hi Patrick,

This indeed seems strange. We are unable to reproduce this behavior, though. Attaching the test page I tried this scenario with.

Veli
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Grid
Asked by
Patrick
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or