您的位置:首页 > 其它

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

2009-09-09 13:59 603 查看
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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: