Data format expression is {0:d}- short date format "05/06/04" (it is wrote
in help "Properties for Bound Columns"), but date is rendered as May 6 2004.
If you look in the help for BoundColumn.DataFormatString, you will find that
D (or d) displays numeric values in decimal format. It shouldn't affect date
fields, which is what you are observing.
You can format dates in code-behind in either ItemDataBound or PreRender
event. Get the cell text, convert it to DateTime and format it back to
string with format expression of your choice.
I am newbie in .NET. May be i am wrong.
I agree with you about numeric value, but i have date value.
In the help for Standard DateTime Format Strings "d" is short date pattern.
If you look in the help for BoundColumn.DataFormatString, you will find
that
D (or d) displays numeric values in decimal format. It shouldn't affect
date
fields, which is what you are observing.
You can format dates in code-behind in either ItemDataBound or PreRender
event. Get the cell text, convert it to DateTime and format it back to
string with format expression of your choice.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.