高华52 2021-03-03 22:07 采纳率: 0%
浏览 42

小白求助 GridView 加合计行不显示 数据

GridView 加合计行不显示 

double sum1 = 0;
                
        protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
               
                sum1 += Convert.ToDouble(e.Row.Cells[7].Text);
                

            }
            // 合计
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[0].Text = "合计";
               e.Row.Cells[7].Text = sum1.ToString();
               
            }
        }

  • 写回答

1条回答 默认 最新

  • 高华52 2021-03-03 22:08
    关注

    哪位朋友帮忙瞅瞅

    评论

报告相同问题?

悬赏问题

  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试