像图上的,我想在最后折合页那一栏显示前边(A4+A3*2+A2*4+其他*4)的值,不知道该怎样去做。
不要数据源的,要rowdatabound的方法,帮帮忙啊,紧急

解决方案 »

  1.   

    不是我不想,我知道那个最简单,可是现在用的是封装好的db方法,没有dbhelper,出不来
      

  2.   

    不是我不想,我知道那个最简单,可是现在用的是封装好的db方法,没有dbhelper,出不来
    这种运算在存储过程里就应该算完的。
      

  3.   

    不管是不是封装好的方法,就算是你自己写的dbhelper,这种事情也不应该交给程序去做。
      

  4.   

    亲,你为什么不用<asp:Repeater> 控件呢!这个灵活多变,比Gridview方便多
      

  5.   

    Refer:http://www.cnblogs.com/insus/articles/1433589.htmlsee also:
    http://www.cnblogs.com/insus/archive/2013/03/21/2973326.html
    http://www.cnblogs.com/insus/archive/2013/03/22/2974970.html
    http://www.cnblogs.com/insus/archive/2013/03/22/2975824.html
      

  6.   

    效果图        protected void Page_Load(object sender, EventArgs e)
            {
                GridView1.DataSource = TM.DBUtility.DbHelperSQL.GetDataTable("select * from Table_1");
                GridView1.DataBind();
            }        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
            {
                if (e.Row.RowIndex >= 0)
                    e.Row.Cells[0].Text = (int.Parse(e.Row.Cells[1].Text) * 3 + int.Parse(e.Row.Cells[3].Text) * 5).ToString();
            }
    前台         <asp:GridView ID="GridView1" runat="server" 
                onrowdatabound="GridView1_RowDataBound">
                <Columns>
                    <asp:TemplateField HeaderText="折合页(id*3+answer*5)" ></asp:TemplateField>
                </Columns>
            </asp:GridView>