如何计算cheboxlist选择的索引更改事件的gridview值的运行总和 [英] how to calculate the running total of gridview values on cheboxlist selected index change event

查看:73
本文介绍了如何计算cheboxlist选择的索引更改事件的gridview值的运行总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,我有一个gridview和一个checkboxlist cheboxlist conatin



以下商品

Dear friend I have one gridview and one checkboxlist cheboxlist conatin

following Items

Apr-15
May-15
Jun-15
Jul-15
Aug-15
Sep-15
Oct-15
Nov-15
Dec-15
Jan-15
Feb-15
Mar-15





我的gridview也有与项目名称相同的列,例如



my gridview also have same column as item name like

Apr-15 May-15 Jun-15 Jul-15 Aug-15 Sep-15 Oct-15 Nov-15 Dec-15 Jan-15 Feb-15 Mar-15





这些列包含整数类型值为



and these column contains integer type value as

Apr-15 May-15 Jun-15 Jul-15 Aug-15 Sep-15 Oct-15 Nov-15 Dec-15 Jan-15 Feb-15 Mar-15
500     0       0      0     0      0      0     0      0       0      0     0
1500    0       0      0     0      0      0     0      0       0      0     0
350     0       0      0     0      0      0     0      0       0      0     0
400    500      500    500   500    500    500   500    500     500    500   500





现在我想计算gridview中列值的运行总数,这意味着如果我从4月15日的cheboxlist中选择两个项目, 5月15日然后我的代码只计算4月15日,5月15日的gridview中的两列的运行总数,如果我从cheboxlist中选择三个项目,例如4月15日,5月15日,6月15日,我的代码只能计算运行总数5月15日,5月15日,5月15日网格视图中的三列。等等......

请任何人建议我们或者说明我们如何做到这一点



now i want to calculate the running total of column value in gridview means if i select two Items from cheboxlist like Apr-15,May-15 then my code can calculate only running total of two column in gridview for Apr-15,May-15 if I select three item from cheboxlist like Apr-15,May-15,Jun-15 my code can calculate only running total of three column in gridview for Apr-15,May-15,Jun -15. and so on...
please any one suggest us or give some idea how we can do this

推荐答案

运行总计可以是以两种方式实现。



这取决于你想要的服务器端或客户端。



两者都可以在以下链接中提到,你可以对如何实现它有一个很好的想法。



在gridview列中运行累计总数



使用jQuery计算ASPNet GridView中的运行总量
The running total can be achieved in couple of ways.

It depends on how you want it Server side or Client side.

Both can be reffered in the following link, you may get a fair idea on how to implement it.

Running Cumulative total in gridview column

Calculate running total in ASPNet GridView using jQuery


这篇关于如何计算cheboxlist选择的索引更改事件的gridview值的运行总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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