[Resolvido] Footer criado no evento RowDataBound
Bom dia,
Estou criando um footer no evento RowDataBound.(GridView)
Quando a página da algum postback esse footer customizado desaparece.
O ViewState da Grid está como true.
Alguem sabe o que poderia ser ?
Obrigado.
protected void grvMotivoAusencia_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
((ImageButton)e.Row.FindControl("btnExcluir")).CommandArgument = e.Row.RowIndex.ToString();
((ImageButton)e.Row.FindControl("btnLog")).CommandArgument = e.Row.RowIndex.ToString();
e.Row.Attributes.Add("onMouseOver", "this.className='GridHover';");
if (e.Row.RowState == DataControlRowState.Normal)
{
e.Row.Attributes.Add("onMouseOut", "this.className='GridRow';");
}
else if (e.Row.RowState == DataControlRowState.Alternate)
{
e.Row.Attributes.Add("onMouseOut", "this.className='GridAlternate';");
}
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
TableCell coluna = new TableCell();
coluna.ColumnSpan = e.Row.Cells.Count;
coluna.CssClass = "GridFooter";
coluna.Text = "Qtd: " + Convert.ToString(grvMotivoAusencia.Rows.Count);
e.Row.Cells.Clear();
e.Row.Cells.Add(coluna);
}
}Discussão (9)
Carregando comentários...