The __do Post Back() of the Cancel button is quite similar to Edit button except that instead of Edit the command name used is Cancel.We won't go into the details of how these are generated by the Grid View in this post but for the sake of our discussion it is suffice to know that the __do Post Back() calls as shown above are made when Edit, Update and Cancel links are clicked.Hi steve, In this scenario the edit operation depends on the bound object that in your case is Data Table/Data Set.
NET Grid View control provides an easy way to edit and update data with the help of Command Field column type.
The default Command Field arrangement is such that the Edit, Update and Cancel buttons are displayed in a column as shown below: The problem with this design is that the Grid View edit column always occupies some screen real estate.
If we use proper command names for the buttons like “EDIT”, “DELETE”, “UPDATE”, “CANCEL” these will also trigger the appropriate Grid View Events.
Ok let’s move on to Code behind what we have to do when user clicks Edit, Delete, Update and Cancel When we click on Edit the On Row Editing event will be fired.
In the template field I will Place a label or some controls, So that it’s very easy to access those controls in the code behind by using Find Control method. Item Template is the content to display for the items in the Template Field.