This code you will write on update button click.
First off all bind primary key of database to datagrid column make it visible false and travel loop as
Code:
foreach(DataGridItem dataItem in DataGrid1.Items)
{
priceText = (TextBox)dataItem.FindControl
("txtBookPrice");
bookIdText = (TextBox)dataItem.FindControl("txtBookId");
Updatecode_for_perticular_row ();
} txtBookPrice= textbox from which you want to update txtBookId= test i.e. unique id coming from database
With help of unique id in for loop find particular text in textbox and update.
Bookmarks