protected void grid_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "DeleteAnswer") { VoiceService.DeleteAnswer(Convert.ToInt32(e.CommandArgument)); } if (e.CommandName == "AddAnswer") { try { var answer = new Answer { Name = ((TextBox)grid.FooterRow.FindControl("txtNewName")).Text, CountVoice = ((TextBox)grid.FooterRow.FindControl("txtNewCountVoice")).Text.TryParseInt(), Sort = ((TextBox)grid.FooterRow.FindControl("txtNewSort")).Text.TryParseInt(), IsVisible = ((CheckBox)grid.FooterRow.FindControl("chkNewIsVisible")).Checked, FkidTheme = ThemeId }; VoiceService.InsertAnswer(answer); } catch (Exception ex) { Debug.LogError(ex); } grid.ShowFooter = false; } if (e.CommandName == "CancelAdd") { grid.ShowFooter = false; } }