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

RadGrid paging stopped working

3 Answers 110 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 27 Jul 2017, 04:05 PM

So paging was working now it doesn't.  Here is the code and grid layout:

GRID

<telerik:RadGrid ID="grdReport" runat="server" AllowPaging="True" AllowSorting="False" ExportSettings-IgnorePaging="true" AutoGenerateColumns="False" PageSize="20" Skin="Office2010Blue" OnPageIndexChanged="grdReport_PageIndexChanged">
                                <GroupingSettings CollapseAllTooltip="Collapse all groups"></GroupingSettings>
                                <ExportSettings FileName="TestRejectReport" IgnorePaging="True">
                                </ExportSettings>
                                <MasterTableView>
                                    <Columns>
                                        <telerik:GridBoundColumn DataField="Line" FilterControlAltText="Filter Line column" HeaderText="Line" UniqueName="Line">
                                            <HeaderStyle HorizontalAlign="Center" Width="20px" />
                                            <ItemStyle HorizontalAlign="Right" />
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="Process" FilterControlAltText="Filter Process column" HeaderText="Process" UniqueName="Process">
                                            <HeaderStyle HorizontalAlign="Center" Width="50px" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="Product" FilterControlAltText="Filter Product column" HeaderText="Product" UniqueName="Product">
                                            <HeaderStyle HorizontalAlign="Center" Width="50px" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="Tested" FilterControlAltText="Filter Tested column" HeaderText="Tested" UniqueName="Tested">
                                            <HeaderStyle HorizontalAlign="Center" Width="30px" />
                                            <ItemStyle HorizontalAlign="Right" />
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="Passed" FilterControlAltText="Filter Passed column" HeaderText="Passed" UniqueName="Passed">
                                            <HeaderStyle HorizontalAlign="Center" Width="30px" />
                                            <ItemStyle HorizontalAlign="Right" />
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="Failed" FilterControlAltText="Filter Failed column" HeaderText="Failed" UniqueName="Failed">
                                            <HeaderStyle HorizontalAlign="Center" Width="30px" />
                                            <ItemStyle HorizontalAlign="Right" />
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="Yield" FilterControlAltText="Filter Yield column" HeaderText="Yield" UniqueName="Yield">
                                            <HeaderStyle HorizontalAlign="Center" Width="30px" />
                                            <ItemStyle HorizontalAlign="Right" />
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="Top5" FilterControlAltText="Filter Top5 column" HeaderText="(Count) Top n Rejects" UniqueName="Top5">
                                            <HeaderStyle HorizontalAlign="Center" Width="800px" />
                                            <ItemStyle HorizontalAlign="Left" Wrap="true" />
                                        </telerik:GridBoundColumn>                               
                                    </Columns>
                                </MasterTableView>                       
                            </telerik:RadGrid>

 

CODE:

I load a datatable (I did see the data in it) and then bind in a button event

grdReport.DataSource = dtReport;
grdReport.DataBind();

Session["Report"] = dtReport;
Session.Timeout = 30;

 

 protected void grdReport_PageIndexChanged(object sender, GridPageChangedEventArgs e)
        {
            //**********
            //pagination
            //**********
            DataTable dt = (DataTable)Session["Report"];
            grdReport.DataSource = dt;
            grdReport.Rebind(); // DataBind();  // note I have tried DataBind and Rebind here
        }

I get no grid when a page is selected.

Thanks for your help in advance.

Mark

3 Answers, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 1
answered on 27 Jul 2017, 05:50 PM
Version I am running: 2016.3.1027.40
0
Mark
Top achievements
Rank 1
answered on 27 Jul 2017, 07:22 PM
So what is it with having to add grd.visibile = true now???  is that a C# issue?  That fixed my problem.
0
Mark
Top achievements
Rank 1
answered on 27 Jul 2017, 07:28 PM
So what is it with having to add grd.visibile = true now???  is that a C# issue?  That fixed my problem.
Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Mark
Top achievements
Rank 1
Share this question
or