protected void ansGrid_UpdateCommand(object source, DataGridCommandEventArgs e) { using (Answers answers = new Answers()) { string fileName = ViewState["editf"].ToString(); string title = ((TextBox)e.Item.Cells[3].Controls[0]).Text; string description = ((TextBox)e.Item.Cells[4].Controls[0]).Text; answers.UpdateAnswerFile(fileName, title, description); } ansGrid.EditItemIndex = -1; BindData(null); }