protected void btnPesquisar_Click(object sender, EventArgs e) { using (var mdse = new RelatorioMetaDesenvolvimentoSE()) { var lstGrid = mdse.ConsultarMetaDesenvolvimentoSe( string.IsNullOrWhiteSpace(cbxNivelOcupacional.SelectedValue) ? 0 : int.Parse(cbxNivelOcupacional.SelectedValue), string.IsNullOrWhiteSpace(cbxUF.SelectedValue) ? 0 : int.Parse(cbxUF.SelectedValue), string.IsNullOrWhiteSpace(cbxCategoriaSE.SelectedValue) ? 0 : int.Parse(cbxCategoriaSE.SelectedValue)); Session.Add("dsRelatorio", lstGrid); if (lstGrid != null && lstGrid.Count > 0) { componenteGeracaoRelatorio.Visible = true; ucFormatoSaidaRelatorio.Visible = true; btnPesquisar.CssClass = "btn btn-default mostrarload"; Filtros.CssClass = "panel-collapse collapse"; } else { componenteGeracaoRelatorio.Visible = false; ucFormatoSaidaRelatorio.Visible = false; } dgRelatorio.DataSource = lstGrid; WebFormHelper.ValidarVisibilidadeCamposGrid(dgRelatorio, chkListaCamposVisiveis.Items); } }