Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
Protected Sub GridView1_RowCommand()
           If e.CommandName.Equals("Delete") Then
'Some code to delete and DataBind gridview
               Dim strmessageEdit As String
                strmessageEdit = "Record Deleted Successfully"
                Dim strScriptEdit As String = "<script runat=server language=JavaScript>alert('" & strmessageEdit & "'); window.location = '" & _
  Page.ResolveUrl("~/Add.aspx") & "';</script>"
                Page.RegisterStartupScript("clientScript", strScriptEdit)
'Response.Redirect("Add.aspx")
          End If
  End Sub
if i reomove "Response.Redirect("Add.aspx")" code means it show "The GridView 'GridView1' fired event Rowediting which wasn't handled." Error Message
Posted

If you remove "Response.Redirect("Add.aspx")" code then you should have to bind the grid again with your datasource.

Please vote and Accept Answer if it Helped to you.
 
Share this answer
 
Comments
sankar guru 1-Oct-10 5:56am    
ur correct ya but i need to change the page, how can i solve it?
NMehta83 1-Oct-10 7:25am    
means? why you need to change the page? explain me....i will help you.
The GridView 'GridView1' fired event Rowediting which wasn't handled

The Above Error probably occurs when you have specified RowEditing event or specified Edit command to the server control i.e Button,LinkButton, and you have not implemented the Event for this.

Hope this Helps.

Please vote and Accept Answer if it Helped.
 
Share this answer
 
Comments
sankar guru 1-Oct-10 5:56am    
Thank U Hiren Solanki,
in your aspx you have specified rowediting event in gridview but in your code behind, there is no such event associated.. you need to define rowediting event in code behind that you have specified in aspx
 
Share this answer
 
Comments
sankar guru 30-Sep-10 2:13am    
RowEditing event will to handle but why cant we use RowCommand() event for all gridview event? and my question is if i place respone.redirecd command there is no error, if i deleted means it show #Quote#The GridView 'GridView1' fired event Rowediting which wasn't handled.#Quote# Error Message.
Change the link button comment name "Edit" to "Edit1"
 
Share this answer
 
Comments
[no name] 27-Jan-12 1:54am    
Thanks I have same problem then i Rename Edit To Edit1 then it run.
Member 8291227 4-Apr-12 1:32am    
Thanks a lot.. saved my Day.. It works..
kk2014 28-Sep-12 7:03am    
if you write CommandName and text same then it will give error 'The GridView 'GridView1' fired event Rowediting which wasn't handled' so that you have to write
protected void grdcontry_RowEditing(object sender, GridViewEditEventArgs e)
{}
but if you give CommandName and text different then it will not give error and no need to write
protected void grdcontry_RowEditing(object sender, GridViewEditEventArgs e)
{}.

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