Phantom page 2?

2 posts, 1 answers
  1. Joel
    Joel avatar
    172 posts
    Member since:
    Oct 2006

    Posted 30 Oct 2008 Link to this post

    Using  radgrid for 2008, 2, 826, 20  .net 2.0

    I have a grid controlled by a dropdown.  Most items in the dropdown cause a single row to be displayed.  1 item in the dropdown causes all row's to be displayed.

    If i choose the option to show all rows first, then with paging move to page 2, then change the dropdown to show a single row, the grid reports that "No records could be found", I assume because it is insisting to show only page 2 of 1.  Same sequence without moving to page 2 results are as expected so it is not a data issue.

    Is there a way for me to force the page back to page 1 on selectedindexchanged event?  Currently the event only does a grid.rebind.

    I am using a .NeedDataSource event in the code behind.  Grid in the .aspx is defined as below.

           <telerik:RadGrid ID="radSurveyResults" runat="server" GridLines="Both" Skin="WebBlue" AutoGenerateColumns="false" AllowPaging="true" PageSize="20" AllowFilteringByColumn="false" AllowSorting="true" > 
                        <HeaderStyle Width="10px" /> 
                        <HeaderStyle Width="20px" /> 
                   <telerik:GridBoundColumn  HeaderStyle-Wrap="false"  DataField="jobcode" HeaderText="Job Code" ItemStyle-Wrap="false"> </telerik:GridBoundColumn>  
                <FilterMenu EnableTheming="True"
                    <CollapseAnimation Duration="200" Type="OutQuint" /> 

  2. Answer
    Sebastian avatar
    9934 posts

    Posted 03 Nov 2008 Link to this post

    Hi Joel,

    To reset the page index for the grid when you change the selected item in the dropdown (and the data source for the grid respectively), merely set <RadGridInstance>.MasterTableView.CurrentPageIndex = 0 before the call to the Rebind() method of the control.

    Best regards,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top