zoukankan      html  css  js  c++  java
  • GridView统计单列或多列的总数

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" ForeColor="#333333" GridLines="None" ShowFooter="True" 
            onrowdatabound="GridView1_RowDataBound">

    //数据统计至页脚显示
        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[9].Text = "实付总额:";
                // dt即数据源DataTable
                e.Row.Cells[10].Text = dt.Compute("sum(买家实际支付金额)", "").ToString();
            }
        }

  • 相关阅读:
    封装
    面向对象的思想
    Arrays工具类
    二分查找
    选择排序
    冒泡排序
    对象数组
    二维数组
    一维数组
    循环语句注意事项
  • 原文地址:https://www.cnblogs.com/smartsmile/p/6234356.html
Copyright © 2011-2022 走看看