如何在Asp.net C#中的Gridview页脚中进行总和? [英] How to do Total sum in Gridview Footer in Asp.net C# ?

查看:78
本文介绍了如何在Asp.net C#中的Gridview页脚中进行总和?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,



祝你有个美好的一天!!



怎么办总和Asp.net中的Gridview页脚C#?

================================== =====



我有一个Gridview,其中包含UserName,Login Time,Logout Time,Duration等字段。我需要在页脚中完成总持续时间



用户名|登录时间|退出时间|持续时间





这些是我的Gridview中的字段



所以,请帮我看看如何在Gridview页脚中进行总持续时间计算。



感谢提前。

Dear Friends,

Have a Good Day !!

How to do Total sum in Gridview Footer in Asp.net C# ?
=======================================

I have a Gridview which has the fields like UserName, Login Time , Logout Time , Duration. I need to do total duration of hours in footer

UserName | Login Time | Logout Time | Duration


These are my Fields in my Gridview

So, Please help me how to do Total Duration Calculations in Gridview Footer .

thanks in Advance.

推荐答案

var result = from p in st.prices select new {
            p.id,
              p.Name,
               p.price1 };
            GridView1.DataSource = result;
            GridView1.DataBind();
            double sum=0;
            foreach(var item in result){

                sum += Convert.ToDouble(item.price1);
            }
            Label lblsum = (Label)GridView1.FooterRow.FindControl("Lbltotal");
            lblsum.Text = sum.ToString();


http://www.aspdotnet-suresh.com/2011/02/how-to-display-sum-of-columns- total-in.html [ ^ ]





希望这会帮助你很多
http://www.aspdotnet-suresh.com/2011/02/how-to-display-sum-of-columns-total-in.html[^]


HOPE THIS WILL HELP YOU A LOT




查看此

Csharp>在gridview页脚C#中显示总小时数[ ^ ]

http://catalog.codeproject.com/Answers/41 4447 /网格视图的总和 - 列应该显示在l?cmt = 282206#answer1 [ ^ ]

总和Gridview列的显示应显示在Gridview底部的最后一行 [ ^ ]

c sharp列值的总和 [ ^ ]

最好的问候

M.Mitwalli
Hi ,
Check this
display total hours in gridview footer C#[^]
http://catalog.codeproject.com/Answers/414447/Sum-of-an-Gridview-Column-should-be-shown-in-the-l?cmt=282206#answer1[^]
Sum of an Gridview Column should be shown in the last row of Bottom in Gridview[^]
sum of column values in c sharp[^]
Best Regards
M.Mitwalli


这篇关于如何在Asp.net C#中的Gridview页脚中进行总和?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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