网格视图中的小计 [英] subtotal in grid view

查看:74
本文介绍了网格视图中的小计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我



i我正在尝试



http://www.gregorylane.com /article.aspx?ID=1



但是无法获得出局



即请参阅小计

每列都有它自己在底部单元格的总数



同样我尝试的方式



以下链接提供输出



http://blog.codovations.com/2009_05_01_archive.html



但它以合并的方式提供小计

解决方案

HI,



您可以像下面这样使用。



  decimal  a =  0 ,b =  0 ,c =  0 ; 

for int i = 0 ; i < (gridview1.Rows.Count); i ++)
{
a = Convert.ToDecimal(gridview1。行[i]。细胞[ 列索引]。Text.ToString());
c = c + a; // 将总数量存储到变量中
}







谢谢


在GridView中显示运行总计 [ ^ ]应该可以帮到你。

please help me

i am trying for

http://www.gregorylane.com/article.aspx?ID=1

but unable to get the out put

i.e please see the subtotal
every column has it''s own total at bottom cell

same way i was trying

below link gives output

http://blog.codovations.com/2009_05_01_archive.html

but it''s providing subtotal in merged way

解决方案

HI,

You can use like the following.

decimal a=0, b=0, c=0;

for (int i = 0; i < (gridview1.Rows.Count); i++)
           {
               a = Convert.ToDecimal(gridview1.Rows[i].Cells["Column Index"].Text.ToString());
               c = c + a; //storing total qty into variable
}




Thanks


Displaying a running total inside a GridView[^] should help you out.


这篇关于网格视图中的小计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆