Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Displaying short date format in GridView
Message
 
To
06/10/2010 15:03:08
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01484208
Message ID:
01484222
Views:
20
>Hi,
>
>I am trying to display just the date part of a datetime field in a gridview, but the time is always displayed. Can anybody see anything wrong with this?
>
>
<ItemTemplate>
>     <mm:mmLabel ID="lblDOB" runat="server" DisplayFormat="{0:d}" CssClass="date" Text='< %# Bind("DateOfBirth") % >'></mm:mmLabel>
></ItemTemplate>
I don't use MM, but you should be able to do something like..
<mm:mmLabel ID="lblDOB" runat="server" CssClass="date" Text='< %# DateTime.Parse(Eval("DateOfBirth")).ToShortDateString() % '></mm:mmLabel>
Since it is a label, Eval makes a little more sense..

Hopefully your date CSSClass isn't interfering.
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform