格式说明符 名称 说明
d 短日期模式
D 长日期模式
t 短时间模式
T 长时间模式
f 完整日期/时间模式(短时间)
F 完整日期/时间模式(长时间)
g 常规日期/时间模式(短时间)
G 常规日期/时间模式(长时间)
M 或 m 月日模式
R 或 r RFC1123 模式
s 可排序的日期/时间模式;
u 通用的可排序日期/时间模式
U 通用的可排序日期/时间模式
Y 或 y 年月模式
任何其他单个字符 未知说明符
[Visual Basic]
Overridable Public Property DataFormatString As String
[C#]
public virtual string DataFormatString {get; set;}
[C++]
public: __property virtual String* get_DataFormatString();
public: __property virtual void set_DataFormatString(String*);
[JScript]
public function get DataFormatString() : String;
public function set DataFormatString(String);
属性值
指定列中各项的显示格式的格式化字符串。默认值为 String.Empty。
Dim dv As New DataView(dt)
Return dv
End Function 'CreateDataSource
Sub Page_Load(sender As Object, e As EventArgs)
If Not IsPostBack Then
' Load this data only once.
ItemsGrid.DataSource = CreateDataSource()
ItemsGrid.DataBind()
End If
End Sub 'Page_Load
</script>
<body>