C
cmay
I am using asp.net 2.0's gridview to display some data.
My data source is a collection of custom objects.
These objects expose a property which is a date.
When I databind and try to format the date with
DataFormatString="{0:d}", I get no change to the display. I still get
hours/minutes/seconds am/pm in the grid.
If I change my object to return a string instead of a date, then the
format string works like I would expect it to. Is there no way to get
it to format a date object?
I don't want to have to change my strongly typed date property to a
string just for display purposes.
Is there anything I can do?
My data source is a collection of custom objects.
These objects expose a property which is a date.
When I databind and try to format the date with
DataFormatString="{0:d}", I get no change to the display. I still get
hours/minutes/seconds am/pm in the grid.
If I change my object to return a string instead of a date, then the
format string works like I would expect it to. Is there no way to get
it to format a date object?
I don't want to have to change my strongly typed date property to a
string just for display purposes.
Is there anything I can do?