Skip to main content

How to Update records using GridView control from ...

How to Update records using GridView control from ...

Sno.
Video name
Description
5
Design_UpdateGV.
Customizing/Designing gridView for updating records from gridView.
6
Update_FromGV_Folder
Firing gridview_RowEditing () to edit gridview , gridview_RowUpdating() to update records from database as well as from website folder. Also, gridview_RowEditCanceling() for cancelling update.
In this tutorial, I am going to update records from table(here qz4) using gridview control in Asp.net hereby combining both the videos. In this tutorial, I am showing you how to update a record(i.e., updating countryName,flag) based on certain countryID(set this field as Primary Key). The field “flag” holds respective country’s flag image path but the actual image is stored on your website folder(here nation).  So, if I update a record it would not only update the said record from database but also from the website folder. That’s it, I am completely updating a record. You need again customize your gridview control’s property in following ways -  
·         Set countryID as DataKeyNames.
·         Edit Template field previously added.
·         Now click it is (gridview events) & then click/ hit Enter on

Gridview_RowEditing() event which is used to update records.Gridview_RowUpdating() to update records from database as well as from website folder. RowEditCanceling() for cancelling update. So watch carefully..