在DataGrid页脚中显示小计 [英] Display SubTotal in DataGrid footer

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

问题描述



我有一个DataGrid列之一是Print.
在那行像这样A0,A1,...

现在我要显示A0总数,A1总数....到我的DataGrid页脚

谁能帮我做到这一点.

我是新使用的DataGrid控件.


提前thanx....

Hi,

I have a DataGrid one of the column is Print.
In that rows are like this A0,A1,...

Now i want to diplay Total of A0, total of A1.... in to my DataGrid Footer

Can any one help me to do this.

I''m newly used this DataGrid control.


thanx in advance....

推荐答案

尝试



十进制总和;
sum = 0
对于(int i,i = 0 to datagridview1.rows.count -1,i ++)
{

sum + = datagridview1.rows(i).cells(您的列的名称").value

}


datagridview1.rows.add(sum,",",")
try it



decimal sum;
sum = 0
for (int i,i = 0 to datagridview1.rows.count -1 ,i++)
{

sum += datagridview1.rows(i).cells("name of ur column").value

}


datagridview1.rows.add(sum,"","","")


这篇关于在DataGrid页脚中显示小计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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