Do you realize that you are always reading the Row 0 means the first Row values always.
int rowIndex = 0;
for (int i = 0; i < gridview1.Rows.Count; i++)
{
TextBox txtcategory = (TextBox)gridview1.Rows[rowIndex].Cells[2].FindControl("txtcategory");
}
Instead of doing this, you should use the variable "i", which is getting incremented.
So, it should be...
for (int i = 0; i < gridview1.Rows.Count; i++)
{
TextBox txtcategory = (TextBox)gridview1.Rows[i].Cells[2].FindControl("txtcategory");
}
Again, I am not sure, if you have all the controls inside the third cell only, because you are reading all values from
Cells[2]
in the code. If that is not correct, then rectify.