问题描述
我有一个中继器,我需要添加小计和一个总计类型为 date 的double字段( times ).
我试过使用lamda表达式获取小计和总计,除了它只给您小计的列表而且我需要整个数据集以及每个日期可能还有其他列或行的功能外,它确实可以工作.
非常感谢您的协助,因为我需要尽快解决此问题.
问候
Danny
I have a repeater and i need to add sub totals and a grand total of a field (timespent) of type double by date field.
I''ve tried using lamda expression to get subtotal and grand total it does work except that it only gives you a list of the subtotal and I need the whole data set with maybe additional column or rows for every date.
Your assistance will be highly appreciated as I need to get this working as soon as posible.
Regards
Danny
推荐答案
我尝试使用lamda表达式来获取小计和总计
I''ve tried using lamda expression to get subtotal and grand total
它与添加几个值完全无关.是的,这是写逻辑的可能方法,但与您的实际问题无关.
好了,关于您的需求,您唯一需要做的就是获取一个类变量并在OnItemDataBound事件处理程序中添加值.
您可以使用
轻松评估此事件处理程序中的数据元素
DataBinder.Eval
如果您不能执行此操作或没有任何想法,请参考:
http://msdn.microsoft.com/en-us/library/c012haty(VS .71).aspx [ ^ ]
:thumbsup:
Is it at all related with adding few values.. Yes it is possible way of writing the logic but not related to your actual problem.
Well, Regarding your requirement, the only thing that you need is to take a class variable and add the values during OnItemDataBound event handler.
You can easily evaluate data elements inside this eventhandler using
DataBinder.Eval
If you cant do this or dont have any idea refer to :
http://msdn.microsoft.com/en-us/library/c012haty(VS.71).aspx[^]
:thumbsup:
这篇关于具有小计和总计的中继器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!