Ver Mensaje Individual
  #2 (permalink)  
Antiguo 18/07/2008, 11:07
Avatar de Peterpay
Peterpay
Colaborador
 
Fecha de Ingreso: septiembre-2007
Ubicación: San Francisco, United States
Mensajes: 3.858
Antigüedad: 16 años, 8 meses
Puntos: 87
Respuesta: Totalizar un grid en su pie de pagina

debes hacer algo como esto

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
int valueQty=0;
if(int.TryParse(e.Row.Cells[3].Text,out valueQty))
total += valueQty;
}
if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells[0].Text = string.Empty;
e.Row.Cells[1].Text = string.Empty;
e.Row.Cells[2].Text = "Total:";
e.Row.Cells[3].Text = total.ToString();
total = 0;
}
}
__________________
Curso WF4
http://cursos.gurudotnet.com/ DF
Aprende HTML5