Gridview rowupdating keys
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.
In this tutorial we are searching for our Text Box controls txt Product Name and txt Unit Price.
To get the Primary Key reference we can use the Data Keys collection of the Grid View.
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.
This can be achieved by setting the property Allow Client Editing to true without the need to define Template Columns.
You just have to double click on a cell to make it editable, edit the values and then change selection to some other row to save the updated values.
These properties will automatically render Edit, Update and Cancel buttons inside Grid View column.
I am using Template Field’s Item Template and Edit Item Template for providing read only and editing interface of the same column in the Grid View.