protected void grid_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "DeleteTheme") { VoiceService.DeleteTheme(Convert.ToInt32(e.CommandArgument)); } if (e.CommandName == "AddTheme") { //TODO validate input try { VoiceService.AddTheme(new VoiceTheme { Name = ((TextBox)grid.FooterRow.FindControl("txtNewName")).Text, IsDefault = ((CheckBox)grid.FooterRow.FindControl("chkNewIsDefault")).Checked, IsHaveNullVoice = ((CheckBox)grid.FooterRow.FindControl("chkNewIsHaveNullVoice")). Checked, IsClose = ((CheckBox)grid.FooterRow.FindControl("chkNewIsClose")).Checked }); grid.ShowFooter = false; } catch (Exception ex) { MsgErr(ex.Message); } } if (e.CommandName == "CancelAdd") { grid.ShowFooter = false; } }