protected void grdIndex_PageIndexChanging(object sender, GridViewPageEventArgs e) { GrdIndex.DataSource = IndexList; if (GrdIndex.DataSource != null) { GrdIndex.PageIndex = e.NewPageIndex; GrdIndex.DataBind(); } }
/// <summary> /// Método para exibir o gridView com valores em branco. /// </summary> private void PreencherGridVazio() { IndexList = new List <Index>(); Index IndexInicial = new Index(); IndexList.Add(IndexInicial); GrdIndex.DataSource = IndexList; GrdIndex.DataBind(); foreach (TableCell cell in GrdIndex.Rows[0].Cells) { cell.Text = " "; } }
public void Consultar() { try { IndexList = new List <Index>(); if (!string.IsNullOrEmpty(txtTitulo.Text.Trim())) { IIndexControlador controlador = IndexControlador.Instance; Index index = new Index(); index.Titulo = txtTitulo.Text.Trim(); IndexList = controlador.Consultar(index, TipoPesquisa.E); GrdIndex.DataSource = IndexList; GrdIndex.DataBind(); } else { IIndexControlador controlador = IndexControlador.Instance; IndexList = controlador.Consultar(); GrdIndex.DataSource = IndexList; GrdIndex.DataBind(); } } catch (Exception ex) { cvaAvisoDeErro.ErrorMessage = ex.Message; cvaAvisoDeErro.IsValid = false; } }