GridView控件实现自定义数字、时间、货币字符串格式

ContractedBlock.gif ExpandedBlockStart.gif Code
<table align="center" bgcolor="#c0de98" border="0" cellpadding="0" cellspacing="1" width="99%">
 
2         <tr>
 
3             <th colspan="2">
 
4                 GridView演示</th>
 
5         </tr>     
 
6        <tr>
 
7            <td colspan="2" style="width: 100%;" >
 
8               <asp:GridView ID="GridView" runat="server" Width="100%" AutoGenerateColumns="False" AllowPaging="True" OnPageIndexChanging="GridView_PageIndexChanging" PageSize="12" >
 
9                 <Columns>
10                       <asp:BoundField DataField="UserID" HeaderText="UserID" />
11                       <asp:BoundField DataField="C_Name" HeaderText="中文名字"  />
12                       <asp:BoundField DataField="Birth" HeaderText="生日"  />
13                       <asp:BoundField DataField="CreateDate" HeaderText="创建时间" DataFormatString="{0:yyyy-MM-dd}"  HtmlEncode ="False"/>  
14                       <asp:BoundField DataField="UpdataDate" HeaderText="更新时间" DataFormatString="{0:M-dd-yyyy}"  HtmlEncode ="False"/>   
15                       <asp:BoundField DataField="salary" HeaderText="RMB符号" DataFormatString="{0:C}"  HtmlEncode ="False"/>  
16                       <asp:BoundField DataField="salary" HeaderText="USD符号" DataFormatString="${0:N2}"  HtmlEncode ="False"/>              
17                   </Columns>
18                   <RowStyle HorizontalAlign="Center" />  
19                   <PagerStyle HorizontalAlign="Right" />
20               </asp:GridView>
21            </td>
22        </tr>       
23 </table>
 

转载于:https://www.cnblogs.com/yinpeng186/archive/2009/09/09/1563239.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值