Onrowupdating not fired

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.

Oddly I have no idea why the data item would not be available given that this particular grid is bound to a Data Table which has persistent backing and is live on the form.

I am storing the Data Table in View State object as we’ll need it later for updating the Grid View row data. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.

If the data is valid and expected, use the Client Script Manager.

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.

Although the Grid View Command Event Args have a Data Item member that member is unfortunately not set with the Data Row as you would maybe expect.

Personally I prefer using Template fields most of the time anyway because usually it gives you much more control.

Using Template fields with Command Argument and Command Name also fires the fires the same Row Command event on the Data Grid.

The problem with the button field is that it's very limited in functionality.

If you need custom text for the caption you can't do that because databinding expressions are not allowed.

But the handling of the Grid View Command Argument is quite different.

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.

Net and when the Row is double clicked the Row will be edited. Net Grid View with three columns of which two are Bound Fields and one is a Template Field column with Update and Cancel Link Buttons which will be visible when the row is edited.