gridview列 数字、货币和日期 显示格式
形式 语法 结果 注释
数字 {0:N2} 12.36
数字 {0:N0} 13
货币 {0:c2} $12.36
货币 {0:c4} $12.3656
货币 "¥{0:N2}" ¥12.36
科学计数法 {0:E3} 1.23E+001
百分数 {0:P} 12.25% P and p present the same.
日期 {0:D} 2006年11月25日
日期 {0:d} 2006-11-25
日期 {0:f} 2006年11月25日 10:30
日期 {0:F} 2006年11月25日 10:30:00
日期 {0:s} 2006-11-26 10:30:00
时间 {0:T} 10:30:00
<1>绑定日期
<2>绑定价格
<3>绑定货币
<4>带参数的链接
<%# Eval("bookName") %>
<5>绑定bool变量
<%# (bool)Eval("IsMain") ? "YES" : "NO" %>
<6>鼠标提示
<7>函数绑定
订单号:<%# Eval("orderID") %><%# DataFormat.isTg((bool)Eval("isTg"))%> | 函数定义如下:
Code
public class DataFormat
{
public static string isTg(bool isTg)
{
string TgTxt = "";
if (isTg)
{
TgTxt = "
(此为团购定单)";
}
return TgTxt;
}
}
<8>绑定JS
全选的JS代码
// JScript 文件
//checkbox全选
function SelectAllCheckboxes(spanChk){
// Added as ASPX uses SPAN for checkbox
var oItem = spanChk.children;
var theBox= (spanChk.type=="checkbox") ?
spanChk : spanChk.children.item[0];
xState=theBox.checked;
elm=theBox.form.elements;
for(i=0;i if(elm[i].type=="checkbox" &&
elm[i].id!=theBox.id)
{
//elm[i].click();
if(elm[i].checked!=xState)
elm[i].click();
//elm[i].checked=xState;
}
}
本文作者:停留的风 来源:http://www.cnblogs.com/yank/
CIO之家 www.ciozj.com 微信公众号:imciow
免责声明:本站转载此文章旨在分享信息,不代表对其内容的完全认同。文章来源已尽可能注明,若涉及版权问题,请及时与我们联系,我们将积极配合处理。同时,我们无法对文章内容的真实性、准确性及完整性进行完全保证,对于因文章内容而产生的任何后果,本账号不承担法律责任。转载仅出于传播目的,读者应自行对内容进行核实与判断。请谨慎参考文章信息,一切责任由读者自行承担。