Click here to Skip to main content
15,879,239 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all
i have this error message when attmping to delete row from grid view
without rebind it ,
"asp gridview fired event rowdeleting which wasn't handled when use DeleteRow"

i use function
gridview1.DeleteRow(grdiview1.SelectedIndex)

i need to delete row then without rebind gridview again
Posted

Where/When exactly are you tring to delete it?

Have a look at Page Life cycle in ASP.NET.[^]
DataBind happends before Pre-render but after PageLoad.

Might be, the reason because of which you get this error is because your codes does not find any value with that index at that time. You need to do it in GridView1_RowDeleting event
 
Share this answer
 
i just make delete for row into linkbutton delete
gridview1.DeleteRow(gridview1.SelectedIndex);
 
Share this answer
 
thank you sandeep for this clarification ,
 
Share this answer
 
What programmers do when they get an error message, is google it to read about what causes it. This error means that you've not written an event handler to handle the event of an attempt to delete a row.


mohammed sadeq wrote:
i need to delete row then without rebind gridview again


This is an utterly retarded request. Your error has nothing to do with rebinding, but it's still stupid. Rebinding is the best way to know for sure your delete worked and that what you're looking at is an accurate representation of what's in your database.
 
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