汇总信息可在Table中的最后一个Td中用Label控件实现。

解决方案 »

  1.   

    PageLoad时用循环求和
    for(int i=0;i<....Tables[0].Rows.Count;i++)//DataSet中Rows的Count值
    {
    count=count+Convert.ToInt32(.....Tables[0].Rows[i]["表的列名字"].ToString());

    }
    然后编辑模版列去Bind就可以了
     <%# DataBinder.Eval....... %>
      

  2.   

    to jjcccc():能否说得细一点。
    to camelials(陈祥):请说得仔细一点,最好能给出完整的源代码或者例子,谢谢两位。
      

  3.   

    你的结果集是DataSet话这样做:
    假设你的DataSet对象名为myDataSet:int intCount=0,intPrice=0;
    for(int i=0;i<myDataSet.Rows.Count;i++)
    {
       intCount+=myDataSet.Tables[0].Rows[i]["数量"];
       intPrice+=myDataSet.Tables[0].Rows[i]["金额"];
    }
    DataRow newRow=new DataRow();
    newRow["名称"]="汇总";
    newRow["数量"]=intCount;
    newRow["金额"]=intPrice;
    myDataSet.Tables[0].Rows.Add(newRow);
    DataGrid.DataSource=myDataSet.Tables[0].DefaultView;
    DataGrid.DataBind();