Gridview rowupdating keys

You can notice that I have kept Required Field Validator too inside the Edit Item Template as I want the textbox to be validated for empty data.

In the same way you can put any kind of Validation controls inside Edit Item Template to validate the form element while user will click Update link.

When Cancel link is clicked on Grid View in edit mode, On Row Canceling Edit event will fire that will call Cancel Record method.

So I have to specify how I want them to appear in the normal view and edit view.

That’s why I have placed different templates like Item Template (for normal view) and Edit Item Template (for edit view).

In this method again, I am getting the primary key value using Data Keys property of the Grid View and using it to delete the records from the database.

After successfully deleting records, again I am calling Bind Data() method to rebind the Grid View.

Leave a Reply