本文介绍了如何在该单元格下方的页脚中显示网格视图的总列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我有一个网格视图来显示结算信息。 gridview的内容包括 s.no.详情数量perunitprice金额 1 xyz 10 1000 10000 2 abc 5 50 250 总计:1250 这里,金额是通过将数量乘以我在gridview的RowDataBound中完成的perunit价格来计算的。 我想在gridview的页脚中显示总金额,如上所示。为了做到这一点,我使用了模板字段。 这是客户端代码。I have a grid view to display the billing information. The content of gridview includess.no. particulars quantity perunitprice amount1 xyz 10 1000 100002 abc 5 50 250 Total: 1250here, amount is calculated by multiplying quantity with perunit price which i have done in RowDataBound of gridview.I wanted to display total amount in footer of gridview as shown above. In order to do so, i have used template field.Here is the client side code.<Columns> <asp:TemplateField HeaderText="S. No"> <ItemTemplate> <%# Container.DataItemIndex + 1 %> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="particulars" HeaderText="particulars" /> <asp:BoundField DataField="Quantity" HeaderText="Quantity" /> <asp:BoundField DataField="Per_Unit_Price" HeaderText="Per Unit Price" /> <asp:BoundField DataField="Amount" HeaderText="Amount" /> <asp:TemplateField> <FooterTemplate> <asp:Label ID="lblTotal" runat="server"></asp:Label> </FooterTemplate> </asp:TemplateField> </Columns> 虽然我收到了页脚总数但页脚显示在第6列但我希望它作为第5列的页脚。 我怎么能这样做..任何帮助???Although i am getting total in footer but the footer is displayed in 6th column but i wanted it as a footer of 5th column.How can i do it.. any help???推荐答案 这篇关于如何在该单元格下方的页脚中显示网格视图的总列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
05-28 08:50
查看更多