zoukankan      html  css  js  c++  java
  • GridView数据汇总代码

      protected void gviewEmployees_RowDataBound(object sender, GridViewRowEventArgs e)
        {

            if (e.Row.RowType == DataControlRowType.DataRow)
            {

                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=\"\"");
                e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor=\"#BFDFFF\"");

                TextBox txt = (TextBox)e.Row.Cells[3].FindControl("txtOrderNum");
                SumConsume += Convert.ToSingle(e.Row.Cells[2].Text.ToString().Substring(1)) * Convert.ToSingle(txt.Text);

            }
            if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[4].Text = "您的消费总额为:" + string.Format("{0:C}", Convert.ToDecimal(SumConsume.ToString()));
            }
        }

  • 相关阅读:
    XML 读取器和编写器从URL读取XML
    8月8号 星期五
    080808 晴
    080805
    雨景
    用photoshop批量修改照片(待修改)
    8月7日 晴
    五不
    Android 画渐变的背景
    iOS开发的一些基础知识
  • 原文地址:https://www.cnblogs.com/zhangchenliang/p/1029669.html
Copyright © 2011-2022 走看看