0
我需要頁腳gridview的總結......總結在GridView
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
decimal totalPrice = 0M;
int totalItems = 0;
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lblPrice = (Label)e.Row.FindControl("lblPrice");
decimal price = Decimal.Parse(lblPrice.Text);
totalPrice += price;
totalItems += 1;
}
if (e.Row.RowType == DataControlRowType.Footer)
{
Label lblTotalPrice = (Label)e.Row.FindControl("lblTotalPrice");
lblTotalPrice.Text = totalPrice.ToString();
}
}
但它不工作。有任何想法嗎?
是啊,它的工作..謝謝... – 2013-03-21 06:31:50