用vb.net在ASP中的gridview列总和 [英] gridview column sum in asp with vb.net

查看:95
本文介绍了用vb.net在ASP中的gridview列总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< b</b> i在网格视图中具有此格式的数据

名称状态item1 item1
abc y 5 4
abc y 3 2
abc y 8 2
xyz n 4 4
xyz n 4 2
xyz n 4 2

------------------------------------------
我想以这种格式在gridview中显示数据
------------------------------------------
abc y 5 4
abc y 3 2
abc y 8 2

总计y 16 8

xyz n 4 4
xyz n 4 2
xyz n 4 2

总计y 12 8

<b></b>i have data in grid view in this format

name status item1 item1
abc y 5 4
abc y 3 2
abc y 8 2
xyz n 4 4
xyz n 4 2
xyz n 4 2

------------------------------------------
and i want data in gridview in this format
------------------------------------------
abc y 5 4
abc y 3 2
abc y 8 2

Total y 16 8

xyz n 4 4
xyz n 4 2
xyz n 4 2

Total y 12 8

推荐答案

任何可能的解决方案都将高度依赖于数据源.例如,如果您要从数据库中提取数据,那么这可能是一个更好的聚集位置,如果您使用的是对象集合,那么在那里进行处理可能会更好.

如果您Google
Any potential solution is going to be highly dependant on the source of your data. For example, if you''re pulling the data from a database, that could be a better place to aggregate, if you''re using an object collection it may well be better handled there.

There are plenty of rusults if you google gridview grouping[^]


这篇关于用vb.net在ASP中的gridview列总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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