Click here to Skip to main content
15,893,722 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Iam developing web application the using three application the problem comes when i want the user to edit data on the gridview, it's giving me this error
[Server Error in '/Zambezi Airlines' Application.
The GridView 'GridView1' fired event RowEditing which wasn't handled.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The GridView 'GridView1' fired event RowEditing which wasn't handled.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): The GridView 'GridView1' fired event RowEditing which wasn't handled.]
   System.Web.UI.WebControls.GridView.OnRowEditing(GridViewEditEventArgs e) +1484061
   System.Web.UI.WebControls.GridView.HandleEdit(Int32 rowIndex) +43
   System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +693
   System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +210
   System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +176
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
]

Anyone to help please, thank you in advance.
Posted
Updated 13-Oct-11 20:47pm
v3
Comments
Al Moje 14-Oct-11 2:19am    
Could you please post your code...

add this to your .aspx.cs page

C#
protected void gridviewid_RowEditing(object sender, GridViewEditEventArgs e)
    {

    }
 
Share this answer
 
i got the same error,but i managed it by:
adding a OnRowEditing event to the gridview , no need to write any code block within the event .
 
Share this answer
 
v3
in gridview (design block)
C#
onrowediting="GridView1_RowEditing"


in code block
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
           int index = Convert.ToInt32(e.NewEditIndex);
            GridViewRow row = GridView1.Rows[index];
            string id = row.Cells[0].Text.ToString();
            ------ ur code 
    }
 
Share this answer
 
Hi,

Try to remove
onrowediting="GridView1_RowEditing"


in you client code
asp:GridView


I suppose this method is not needed, unless you want to put logic/action in this event

Hope this could help...

Regards,
Algem
 
Share this answer
 

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