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.
None of them feels natural to me, so quite frequently - especially if I haven't written that code in a while - I spent way more time than I should rediscovering what approach I should use the hard way.
If you need custom text for the caption you can't do that because databinding expressions are not allowed.
The following does not work: because it's not a template container.
Also notice that if you have both Button Fields/Command Fields and template items that have command arguments, the Command Argument will contain different things.
In the case of a Command Field the Command Argument is the Row Index.
Here's some code that needs to retrieve a Pk of one of the bound items and then perform some work on the data (in this case the business object): This seems like a lot of code to have to write just to retrieve data context.
The code first has to retrieve the Grid View Row, which is done by retrieving the Command Argument which in this case a row index of the rendered grid view items.
First here's the implementation of a couple of Link Buttons in the template I can specify a command argument which is nice because it lets me be very concise about what data I want to pass to the Row Command event.
In the event handler the code to retrieve the PK in this case becomes considerably simpler, but as we'll see it's a little harder to get a reference to the underlying data source control if that needs to be updated.
So I'm taking a few minutes - for my own sake - to write this stuff down so I can look it up next time I have a brain fart Using a Button Field you can specify a Command Name which in turn provides the On Row Command event some context as to what type of operation you are dealing with in Code Behind.