如何避免出现在gridview的boundfield中的小时和秒 [英] how to avoid hours and seconds appearing in boundfield of gridview
本文介绍了如何避免出现在gridview的boundfield中的小时和秒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在gridview的一个boundfield中,我无法抑制与date一起出现的小时和秒。我的'exp_date'列是日期类型。以下是我的代码:
< asp:BoundField DataField = exp_date HeaderText = expiry / >
解决方案
尝试
< asp:boundfield datafield =exp_datexmlns:asp =#unknown > dataformatstring ={0:dd,mm,yyyy}htmlencode =false HeaderText =expiry/> < / ASP:绑定列>
In one of the boundfield of gridview I am unable to suppress the hours and seconds that appears alongwith date. My 'exp_date' column is of date type. Hereunder is my code:
<asp:BoundField DataField="exp_date" HeaderText="expiry" />
解决方案
Try
<asp:boundfield datafield="exp_date" xmlns:asp="#unknown">dataformatstring="{0:dd,mm, yyyy}" htmlencode="false" HeaderText="expiry" /> </asp:boundfield>
这篇关于如何避免出现在gridview的boundfield中的小时和秒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文