does datagridview cell can have datetime pattern (" / / ")
or (" . . "), that the user can entering only between
two slash or two dots in datagridview cell ?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suthish NairPosted Feb 4, 2011, 2:18 PM
So other members can easily find the answers.
Suthish NairPosted Feb 1, 2011, 1:36 PM
refer articles:
MaskedTextBox in VB.NET
Masked TextBox Control
Vishwa RajPosted Feb 1, 2011, 6:15 AM
Soft CornerPosted Jan 10, 2011, 1:22 AM
There are different patterns for gridview,
for e.g :
we need to include DataFormatString = "{0:d}" for the BoundColumn to display a short date.
The following table shows some date format strings that can be used to format date in GridView columns,
Format Pattern
Name
Example
d
Short date
11/8/2008
D
Long date
Sunday, August 11, 2008
t
Short time
3:32 PM
T
Long time
3:32:00 PM
f
Full date/time
(short time)
Sunday, August 11, 2008 3:32 PM
F
Full date/time
(long time)
Sunday, August 11, 2008 3:32:00 PM
g
General date/time
(short time)
8/11/2008 3:32 PM
G
General date/time
(long time)
8/11/2008 3:32:00 PM
m or M
Month day
August 11
r or R
RFC 1123
Sun, 11 Aug 2008 8:32:00 GMT
s
Sortable date/time
2008-08-11T15:32:00
u
Universable sortable date/time
2008-08-11 15:32:00z
U
Universable sortable date/time
Sunday, August 11, 2008 11:32:00 PM
y or Y
Year month
August, 2008