protected void Page_Load(object sender, EventArgs e)
    {
        DataTable dt = new DataTable();
        DataRow dr;
        dt.Columns.Add("id", typeof(String));
        dt.Columns.Add("price", typeof(float));        dr = dt.NewRow();
        dr["id"] = "001";
        dr["price"] = 123;
        dt.Rows.Add(dr);        dr = dt.NewRow();
        dr["id"] = "002";
        dr["price"] = 123;
        dt.Rows.Add(dr);        this.GridView1.DataSource = dt;
        this.GridView1.DataBind();
    }
    int price = 0;
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            price += Convert.ToInt16(DataBinder.Eval(e.Row.DataItem, "price"));
        }
        else if (e.Row.RowType == DataControlRowType.Footer)
        {
            e.Row.Cells[0].Text = "合计:";
            e.Row.Cells[1].Text = price.ToString();
            e.Row.Cells[1].HorizontalAlign = HorizontalAlign.Right;
            e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Right;
        }
    }datagrid显示,就要求出一列的和,然后显示在最后一行,可是我的代码没有报错,但是就是没显示出来。现在显示:
id price 
001 123 
002 123希望显示: 
id price 
001 123 
002 123
合计:246我写的那里错了?