0

I have an ASPX application with C# .In a page I have a gridview with paging(i add allowpaging="true",PageSize="2"). In aspx file :

  <table>
    <tr>
        <td>
            <asp:GridView ID="grdClientList" runat="server" OnRowCreated="grdClientList_RowCreated"
                OnRowDataBound="grdClientList_RowDataBound" AutoGenerateColumns="False" 
                DataSourceID="ODSClientList" DataKeyNames="ID"
                AllowPaging="true" AllowSorting="true" PageSize="2"
                OnPageIndexChanging="grdClientList_PageIndexChanging">
                <Columns>
                    <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" 
                        ItemStyle-CssClass="hidden"  HeaderStyle-CssClass="hidden" />
                    <asp:BoundField DataField="Name" HeaderText="<%$Resources:HRWebApplicationResources,ClientsList_ColName %>" SortExpression="Name" 
                         ControlStyle-Width="150px" ItemStyle-Width="150px"/>
                    <asp:BoundField DataField="Address" HeaderText="<%$Resources:HRWebApplicationResources,ClientsList_ColAddress %>" SortExpression="Address" 
                        ControlStyle-Width="280px" ItemStyle-Width="280px"/>
                    <asp:BoundField DataField="Contact" HeaderText="<%$Resources:HRWebApplicationResources,ClientsList_ColContact %>" SortExpression="Contact"
                         ControlStyle-Width="100px" ItemStyle-Width="100px"  />
                    <asp:BoundField DataField="Telephone" HeaderText="<%$Resources:HRWebApplicationResources,ClientsList_ColTelephone %>" SortExpression="Telephone" 
                         ControlStyle-Width="100px" ItemStyle-Width="100px" />
                    <asp:BoundField DataField="Email" HeaderText="<%$Resources:HRWebApplicationResources,ClientsList_ColEmail %>" SortExpression="Email" 
                        ControlStyle-Width="130px" ItemStyle-Width="130px" />
                    <asp:HyperLinkField 
                          HeaderText="<%$Resources:HRWebApplicationResources,AllPages_Actions%>" ShowHeader="True" Text="Edit"
                          DataNavigateUrlFormatString="~/Client/ClientDetail.aspx?Id={0}" 
                          DataNavigateUrlFields="ID" ControlStyle-Width="70px" ItemStyle-Width="70px"/>
                </Columns>
            </asp:GridView>
        </td>
    </tr>
</table>

 <asp:ObjectDataSource ID="ODSClientList" runat="server" OldValuesParameterFormatString="{0}"
    SelectMethod="GetAllClientsByFilter" TypeName="HRWebApplication.AppCode.ManageList">
    <SelectParameters>
       <asp:ControlParameter ControlID="txtSearchName" Name="p_strName" PropertyName="Text" Type="String" />
       <asp:ControlParameter ControlID="txtSearchAddress" Name="p_strAddress" PropertyName="Text" Type="String" />
       <asp:ControlParameter ControlID="txtSearchContact" Name="p_strContact" PropertyName="Text" Type="String" />
       <asp:ControlParameter ControlID="txtSearchTelephone" Name="p_strTelephone" PropertyName="Text" Type="String" />
       <asp:ControlParameter ControlID="txtSearchEmail" Name="p_strEmail" PropertyName="Text" Type="String" />
    </SelectParameters>
</asp:ObjectDataSource>

In cs file:

  protected void grdClientList_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        grdClientList.PageIndex = e.NewPageIndex;
        grdClientList.DataBind();
    }

My application doesn't do anything when I click the second,third,etc page.Doesn't enter in to " grdClientList_PageIndexChanging" event.Does anyone know why?

Amarnath Balasubramanian
  • 9,300
  • 8
  • 34
  • 62
user1577242
  • 413
  • 2
  • 13
  • 29

1 Answers1

0

Maybe try PageIndexChanged instead of PageIndexChanging?

markp3rry
  • 724
  • 10
  • 26