views:

86

answers:

1

Hi,

I am using commandfield edit button to edit the row of the gridview. But unable to perform the basics.

This gridview is in update panel. When I press Edit button it shows UPDATE and CANCEL button but when I press UPDATE button it updates the DB but UPDATE button doesn't go back to EDIT one.

While Cancel is working as it should. Like on pressing CANCEL it goes back to EDIT button,

What I am doing worng.

Thanks.

A: 

have you written following line of code in rowupdating event

protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) 
{ 
  GridView1.EditIndex = -1;
  bindGrid();
}
Pranay Rana