在gridview的末尾/页面末尾添加总计 [英] adding a total amount at the end of gridview /at the end of page

查看:78
本文介绍了在gridview的末尾/页面末尾添加总计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi

我需要在网格视图的末尾获得该列的总数,或者将其作为页面的末尾或标签添加到页面的末尾.我没有使用row_datadound事件,因为我在网格视图中是不透明的绑定.获取仅此列的总和.



hi

i need to get the total of this column at the end of grid view either as a column at the end or a label at the end of page .I am not using row_datadound event as i am direclty binding in the grid view.I need to get the sum of only this column.



<asp:TemplateField HeaderText="Invoice amount " HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
 <itemtemplate>
<asp:Label ID="lbInvoiceAmount" runat="server"  Text='<%# Bind("NetAmount") %>'>
        </itemtemplate>




非常感谢




Thanks much

推荐答案

在这里您将找到解决方法

http://csharpdotnetfreak.blogspot.com/2009/07/display-total- in-gridview-footer.html [ ^ ]

如果您不想使用rowdatabound事件,那么执行此操作的一种方法是使用Rollup从数据库中获取结果.但是,如果执行此操作,则不能使用gridview分页,则必须使分页结果来自数据库.另外,最后一行将显示结果,而不是页脚.
Here you will find the way to do it

http://csharpdotnetfreak.blogspot.com/2009/07/display-total-in-gridview-footer.html[^]

If you dont want to use the rowdatabound event then one way to do this is to get the result from database with Rollup. but if you do this you cannot use the gridview paging, you will have to have the paged results coming from the DB. Also, the last row will show the results and not the footer.


http://forums.asp.net/t/1731353.aspx [ http://aspalliance.com/782_CodeSnip_How_to_Display_Sum_Total_in_the_Footer_of_the_GridView_Control [ ^ ]
CodeProject Frequently Asked Questions Series 1: The ASP.NET GridView[^] should help you display a running total at the end of a Grid View.

Without using Row_DataBound, try
http://forums.asp.net/t/1731353.aspx[^]
http://aspalliance.com/782_CodeSnip_How_to_Display_Sum_Total_in_the_Footer_of_the_GridView_Control[^]


引用:
GridView-页脚总计-不使用rowdatabound [
Refer:
GridView - total in footer - not using rowdatabound[^]


这篇关于在gridview的末尾/页面末尾添加总计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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