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

Phantom page 2?

1 Answer 33 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 2
Joel asked on 30 Oct 2008, 08:37 PM
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" > 
            <MasterTableView> 
                <RowIndicatorColumn> 
                    <HeaderStyle Width="10px" /> 
                </RowIndicatorColumn> 
                <ExpandCollapseColumn> 
                    <HeaderStyle Width="20px" /> 
                </ExpandCollapseColumn> 
                  <Columns> 
               <telerik:GridBoundColumn  HeaderStyle-Wrap="false"  DataField="jobcode" HeaderText="Job Code" ItemStyle-Wrap="false"> </telerik:GridBoundColumn>  
 
     
                </Columns> 
            </MasterTableView> 
            <FilterMenu EnableTheming="True"
                <CollapseAnimation Duration="200" Type="OutQuint" /> 
            </FilterMenu> 
        </telerik:RadGrid> 


1 Answer, 1 is accepted

Sort by
0
Accepted
Sebastian
Telerik team
answered on 03 Nov 2008, 11:14 AM
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,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Joel
Top achievements
Rank 2
Answers by
Sebastian
Telerik team
Share this question
or