zoukankan      html  css  js  c++  java
  • 简单随笔——如何在gridview的页脚显示信息。。。。

    我是超级大菜鸟。。。哈哈 

    先上图看看是不是你需要的

    第一步,右击gridview,在事件中,单击RowdataBond事件。

    在这之前一定要记得在gridview属性中的ShowFooter设置为“true”。

    第二步,需要实现这个功能可以看看我的代码。

     1   protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
     2 
     3      {
     4         if (e.Row.RowType == DataControlRowType.DataRow)
     5         
     6         
     7         {
     8             if (e.Row.RowIndex > -1)
     9 
    10             {
    11              
    12                 sum1 += Convert.ToDouble(e.Row.Cells[4].Text);
    13                 sum2 += Convert.ToDouble(e.Row.Cells[5].Text);
    14                 sum3 += Convert.ToDouble(e.Row.Cells[6].Text);
    15 
    16             }
    17  
    18         }
    19         else if (e.Row.RowType == DataControlRowType.Footer)
    20         {
    21             e.Row.Cells[3].Text = "金额合计";
    22             e.Row.Cells[4].Text = sum1.ToString();
    23             e.Row.Cells[5].Text = sum2.ToString();
    24             e.Row.Cells[6].Text = sum3.ToString();
    25         }
    26 
    27     }
    View Code
  • 相关阅读:
    vue 響應接口
    vue ajax
    vue混入
    vue動畫和過渡
    vue路由
    vue自定義指令
    python项目_使用极验验证码
    python项目_使用异步功能,celery
    python项目_集成短信发送功能
    python项目_redis使用
  • 原文地址:https://www.cnblogs.com/dreamstartyoung/p/3541705.html
Copyright © 2011-2022 走看看