Exemplo n.º 1
0
 protected void grdIndex_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     GrdIndex.DataSource = IndexList;
     if (GrdIndex.DataSource != null)
     {
         GrdIndex.PageIndex = e.NewPageIndex;
         GrdIndex.DataBind();
     }
 }
Exemplo n.º 2
0
    /// <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 = "&nbsp;";
        }
    }
Exemplo n.º 3
0
    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;
        }
    }