Can't format a databound date

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?
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top