如何在ASP.NET中动态创建的gridview中添加带标签的页脚 [英] How to add footer with label in dynamically created gridview in ASP.NET

查看:88
本文介绍了如何在ASP.NET中动态创建的gridview中添加带标签的页脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上我创建了网格dyanamically所有列都来自数据库。现在我想在页脚实验中显示列值的总和



我尝试了什么:



actually i created grid dyanamically all clumns are came from database .now i want to display sum of column values in footer labes

What I have tried:

<asp:GridView ID="AIGrid" runat="server"

                                                      AutoGenerateColumns="False" PageSize="25"

                       AllowPaging="true" OnPageIndexChanging="OnAIGrid_PageIndexChanging" ShowFooter="true"  OnRowCreated ="AIGrid_RowCreated"

                   Font-Size="10pt" CssClass="grid" OnRowDataBound="AIGrid_RowDataBound">
                   <Columns>

                   </Columns>
                   </asp:GridView>



this是我的aspx页面,我的cs页面代码在下面




this is my aspx page and my cs page code is in below

if (e.Row.RowType == DataControlRowType.Footer)
        {
            GridViewRow Footerrow = new GridViewRow(1, 0, DataControlRowType.Footer, DataControlRowState.Insert);
            Label  txtCountry = new Label();
        }

推荐答案

检查这个

使用ASP.Net中的GridView页脚中的总列数显示总和C#和VB.Net [ ^ ]

在页脚显示总和 [ ^ ]
check this
Display sum of Columns total in GridView Footer in ASP.Net using C# and VB.Net[^]
display sum at footer[^]


这篇关于如何在ASP.NET中动态创建的gridview中添加带标签的页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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