Gridview rowupdating keys kristne datingsider Bornholm
However, if you need to get at the actual live data item the work requires first to get the control that fired the event (Link Button), walking up to its naming container (Grid View Row) and then getting the Data Item Index.
From there I can then retrieve the Data Row based on the index.
UPDATE If Name is not returning from datasource, you should either create new entity which contains Name field as well, or use some constant name, like you are declaring in a page (not sure it this same name should be shown in every row).
I don't know about you, but I cringe every time I need to create a Grid View based layout that needs to create a few custom link handlers off that grid.
When it's all said and done neither of these approaches is particularly complex.
The typical scenario might be a list where you can toggle certain options or where you can fire an operation that otherwise updates the data that's underlying the grid.
I tend to use business objects in my applications so using the standard data controls doesn't work very well, nor would it really buy much in terms of abstraction.
In my code I tend to write the databinding logic as part of the page logic which usually is just a couple of lines of code.
Anyway, the problem isn't that it can't be done 'manually' - but rather that there are a myriad of ways that you can hook up custom link/command processing and they are all similar but yet quite different.
Search for gridview rowupdating keys:
It seems to me that Grid View Event Args could have included a consistent mechanism to expose both the Data Item Index as well as the Data Item itself.