Link to home
Start Free TrialLog in
Avatar of ndr-itsolutions
ndr-itsolutions

asked on

Date Time issue with EditTemplate and Gridview

I recently had a question answered about formatting the way a date was displayed in a gridview, so I has 31/01/2013 00-00-00, adding {0:dd-MM-yyyy}, then took out the time and solved my issue.
I'm new to this and can't work out how I would fix this in a edittemplate field with a calendar control embedded ??
Avatar of Obadiah Christopher
Obadiah Christopher
Flag of India image

What calendar control are you using?
Avatar of ndr-itsolutions
ndr-itsolutions

ASKER

The standard calendar control that comes with Web Developer Express 2010.
I'm sorry but why are you looking for the dateformat? Could you elaborate the question a bit
When I select a date within the calendar, it appears as 31/01/2013 00:00:00, when I update the gridview. However on columns that I don't have as edit templates I simply add the {0:dd-MM-yyyy} to dataformatstring column.
Are you using SqlDataSource?
Yes
In case you are using a label

Use
Text='<%# Eval("DateColumn","{0:dd-MM-yyyy}") %>'

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Monica P
Monica P
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial