Rowupdating in gridview in asp net is shane sparks dating anyone
In my case this was happening because I was binding to a List of custom objects.
Note A common mistake that a lot of people do is that they perform a databind each and every-time the Page_Load method is called.
Right now, I have not written code for the Update event. Right now, I have not written code for the Update event. Then the page posts back, the text boxes go back to being labels and the new values are lost, and the Row Updating code never fires.
Yes, I did put the breakpoint at the Row Updating line (and not in the function).
But as I noted in the comments in that method, some collections that should contain the columns (names, old values and new values) are always empty. And the Row Updated method is never even touched!!! NET Forums that I need to use a Data Source control.
For example a Sql Data Source, which is automatically added to your Web Form if you drag-n-drop your way around Visual Studio 2005.
Obviously the simplest method is to use Data Key Names on the Grid View and then you should have the data in your Grid View Update Event Args as part of e. (In the following example, I cast to a Check Box as I know I have a checkbox at the col Index You Are Interested In - you should cast to whatever control you have in that column).
Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free.
You'll be able to ask questions about coding or chat with the community and help others.
I'm having a very hard time understand what would prevent your event from being fired.
Do you have some sort of Java Script functionality that may be stopping it? A common problem people have with Grid Views is understanding when to data bind the data source to the Grid View.