zoukankan
html css js c++ java
GridView显示总合计
<
asp:GridView
ID
="GridView1"
runat
="server"
Width
="100%"
DataKeyNames
="ID"
AutoGenerateColumns
="False"
OnRowDataBound
="GridViewIw1_RowDataBound"
>
<
Columns
>
。。。。。。。。。。。。。。。
<
asp:BoundField
DataField
="SumPrice"
HeaderText
="金额"
SortExpression
="SumPrice"
DataFormatString
="{0:C}"
HtmlEncode
="False"
>
<
itemstyle
width
="8%"
/>
</
asp:BoundField
>
。。。。。。。。。。。。。。。。。
</
Columns
>
</
asp:GridView
>
格式化的时候一定要把
HtmlEncode设为
"False"
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
DataControlRowType lit = e.Row.RowType;
if (lit == DataControlRowType.Footer)
{
TableCell tcprice = e.Row.Cells[3];
TableCell price = e.Row.Cells[4];
tcprice.Text = "总金额:";
tcprice.HorizontalAlign = HorizontalAlign.Right;
price.Text = "¥"+GetPrice();
}
}
private string GetPrice()
{
return "3459";
}
在脚里就能显示总合计了!
查看全文
相关阅读:
special word count
Regular Expression
position 之 fixed vs sticky
查看linux并发连接数的方法
Linux/Unix环境下的make命令详解(转)
Redis数据结构(转)
maven中依懒scope说明
mysql主从复制
linux查看是否已经安装某个软件
在mac下使用py2app打包python项目
原文地址:https://www.cnblogs.com/anson/p/457113.html
最新文章
HDFS文件操作(命令行)
linux挂载和卸载NAS操作
mongdb增加字段和删除字段
安卓模拟器下载
myeclipse10安装SVN插件
在线生成myeclipse注册码
雷达数据文件缺报时段判断程序
查找两个List集合中的不同元素
查找两个数组的不同元素
查找两个数组的相同元素
热门文章
java获取文件名的方法
在eclipse中使用easyui
eclipse中配置tomcat服务器
Json
Event flow
箭头函数
MAP.API
Object
For each···in / For···in / For···of
History of Program
Copyright © 2011-2022 走看看