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

RadGrid paging button not working in c#.net web application.

1 Answer 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aspelec
Top achievements
Rank 1
Aspelec asked on 09 Dec 2014, 07:11 AM
grid is loading and when i am clicking on page numbers its working, but next precious button is not workng. and its not showing any error message also

Please help.

thanks,

please find the below code : 


design page :

<asp:ScriptManager ID="ScriptManager1" ScriptMode="Release" runat="server" EnablePageMethods="true">
                </asp:ScriptManager>
                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                </telerik:RadAjaxManager>
                <telerik:RadGrid ID="telGrid" runat="server" AllowPaging="True" AllowSorting="True" PageSize="10"
                    AllowFilteringByColumn="True" OnPageIndexChanged="PhaseView_PageIndexChanged" OnNeedDataSource="PhaseView_NeedDataSource">
                    <MasterTableView AutoGenerateColumns="false" TableLayout="Fixed">
                        <Columns>
                            <telerik:GridBoundColumn DataField="DrugId" HeaderText="DrugId" UniqueName="DrugId">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="DDC_CODE" HeaderText="DDC_CODE" UniqueName="DDC_CODE">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="TRADE_NAME" HeaderText="TRADE_NAME" UniqueName="TRADE_NAME">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="STATUS" HeaderText="STATUS" UniqueName="STATUS">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
                        <Selecting AllowRowSelect="true" EnableDragToSelectRows="false" />
                    </ClientSettings>
                </telerik:RadGrid>

code behind :

protected void PhaseView_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            loadgrid();
        }
        private void loadgrid()
        {
            DataTable dtDrug = new ClinicBLL.Settings.Settings_DrugBLL().GridLoad_FetchForUpdate();

            if (dtDrug != null && dtDrug.Rows.Count > 0)
            {
                telGrid.DataSource = dtDrug;
                telGrid.DataBind();
            }
        }


1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 11 Dec 2014, 04:08 PM
Hello,

I went through the provided code and noticed that you are calling DataBind() inside loadgrid(). Note that you should not call the DataBind() method in the NeedDataSource event handler, it will be called internally when needed. Therefore, I recommend you comment   telGrid.DataBind(); line in your code and see if the problem still persists.

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Aspelec
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or