Click here to Skip to main content
15,893,266 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<asp:GridView ID="GridView1" runat="server" Width="491px" PageSize="2" AllowPaging="True" >
</asp:GridView>


and an error occurred: The GridView 'GridView1' fired event PageIndexChanging which wasn't handled.

Please help me.
Thanks!
Posted
Updated 16-May-11 23:44pm
v2

In the PageIndexChanging event you have to write code

DataGrid1.CurrentPageIndex = e.NewPageIndex;
DataGrid1.DataSource = myDataset;
DataGrid1.DataBind();
 
Share this answer
 
v2
try this

<asp:gridview id="grdOrder" runat="server" autogeneratecolumns="False" allowpaging="True" onpageindexchanging="grdOrder_PageIndexChanging ">
</asp:GridView>
       
//In Code Behind
protected void grdOrder_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
        try
        {
            grdOrder.PageIndex = e.NewPageIndex;
            grdOrder.DataSource = //Your Function to bind Data or DataSet
            grdOrder.DataBind();
        }
        catch (Exception ex)
        {
            throw ex;
        }
        }
 
Share this answer
 
v2
Comments
Dharmpal Dhaka 17-May-11 5:45am    
sir
grdOrder.PageIndex = e.NewPageIndex;
here NewPageIndex property not showing at me
Mahendra.p25 17-May-11 5:49am    
post your Code.
Mahendra.p25 17-May-11 5:53am    
You need to generate your grid PageIndexChanging event and your GridId is "GridView1" not "grdOrder"
Try
Paging in a GridView Web Server Control[^] and
Take a look at this[^] article to learn how to do paging.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900