To do this we first need to obtain the reference of the current row by using its index no as shown in the first line below.
By using the Grid View Row object we can find the reference of any control in the row in which user is editing the data.
The visitors to a web site can typically be divided into two groups: the users and the administrators.
In data driven web sites, users are normally allowed to view data and administrators are allowed to add, edit or delete data.
Please keep in mind that there are many different ways to update the database using the Grid View control depending on the type of data you are updating and the functionality the user need and there are many solutions to achieve the same end result.
In the above tutorial I tried to give you one of the easiest solutions and I hope you can go explore Grid View control editing further after learning the basics from this tutorial.
Software architect with over 10 years of proven experience in designing & developing n-tier and web based software applications, for Finance, Telecommunication, Manufacturing, Internet and other Commercial industries.
He believes that success depends on one's ability to integrate multiple technologies to solve a simple as well as complicated problem. protected void Grid View_Row Canceling Edit(object sender, Grid View Cancel Edit Event Args e) protected void Grid View_Row Data Bound(object sender, Grid View Row Event Args e) protected void Grid View_Row Editing(object sender, Grid View Edit Event Args e) // MASTER DATA IN A DATASET. Sql Data Adapter Sql Adapter; protected void Page_Load(object sender, Event Args e) private bool set Conn() // CANCEL ROW EDITING.NET Grid View markup and associated code lets first enumerate the important code pieces of this tutorial.In the above code, I set two properties Show Edit Button and Show Cancel Button of Command Field.This collection only requires the row index no and it will give us the primary key.