Formatting a date in a datagrid

  • Thread starter Thread starter William Gower
  • Start date Start date
W

William Gower

I have a datagrid that has a column that displays a date. The date is
currently being displayed in a long format, I want to format it to display
in short format. How do I do that in a datagrid?
 
Go to the Property Builder (right-click on the datagrid for the context
menu). Assign a column to the date field if you haven't already (don't
autogenerate columns). Pick that column, and assign a format of "{0:d}" to
it.
 
Hello William,

I have a datagrid that has a column that displays a date. The date is
currently being displayed in a long format, I want to format it to
display in short format. How do I do that in a datagrid?
 
Thanks that got me half way there. It shows now Sunday January 3, 2004. I
want it to show 01/03/2004
 
William Gower said:
Thanks that got me half way there. It shows now Sunday January 3, 2004. I
want it to show 01/03/2004

Use a lowercase d instead of uppercase.
 
Hi
Thanks that got me half way there. It shows now Sunday January 3, 2004. I
want it to show 01/03/2004

use the DataFormatString = "{0:MM/dd/yyyy}"

HTH
Regards
Ashish M Bhonkiya

William Gower said:
Thanks that got me half way there. It shows now Sunday January 3, 2004. I
want it to show 01/03/2004
 
Back
Top