Gridview rowupdating get new value
Unfortunately these dictionaries are only filled out if you are bound to a datasource control :(.
So that means when you bind to some raw collection and hook up to the Data Source property then call databind, if you try to handle the delete or update events these dictionaries are going to be empty.
There is alot of magic going on behind the scenes (which I will blog about in a separate post), but you do not need to know how it works to use it, e.g expression then the value of the Text property is pushed into a dictionary which the data control can retrieve later.
So how does Grid View/Form View/Details View/List View get these values?
From the time you write code that depends on the immediate layout of your page then your asking for trouble.
I'd like to know if there are any other ways to retrieve the new values?
Forgive me for the variation in my code formatting I'm trying to find the right one.
If we look at this event we can see the Grid View nicely packages for us the new values, old values and the keys for the updating row.
I know its very annoying and hard to get the data out of the data controls (gridview in this case), but there are other things you can do to make it easier.
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.