Private Sub DataGridView1_ColumnAdded(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewColumnEventArgs) Handles DataGridView1.ColumnAdded
If e.Column.ValueType Is System.Type.GetType("System.DateTime") Then
e.Column.DefaultCellStyle.Format = "yyyy-MM-dd hh:mm:ss"
End If
End Sub
,
Tips and tricks for .NET using ASP and VB code.
Formatting dates in a data grid view to display seconds.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment