Formatting Gridview date as mm/dd/yy when editing a Gridview

Hi, I have an ASP.NET Gridview where I have a Date column which I want to be formatted as dd/mm/yy. Therefore I have added DataFormatString="{0:dd/MM/yy}" to the DataField control. This ensures that the dates are displayed as dd/mm/yy in the Gridview however I have editing enabled and when this is used the Gridview still expects an entry in the format mm/dd/yyyy.

Any help on how to rectify this would be much appreciated. Many thanks.
eddie1747Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tony_angelopoulosCommented:
do you have a separate edit template?  You might need to specify this in the edit item template as well.
0
eddie1747Author Commented:
No I don't have a seperate template. I am just enabling editing within the GridView.
0
tony_angelopoulosCommented:
instead of {0:dd/MM/yy} try:
{0:d}

or

d
0
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

eddie1747Author Commented:
{0:d}  also works fine for displaying the data but its when I come to edit it through the GridView that it expects an entry in the format MM/dd/yyyy hh:mm:ss

Maybe I should have mentioned earlier that I am linking the GridView to a SQL Data Source.

I assume I need to format the actual data at source level rather than just formatting the way it is displayed in the Gridview. Is there a relatively simple way of achieving this this?
0
tony_angelopoulosCommented:
I think that's where an edit template would help.  You could actually specify a calendar control or custom text box control to fix this behavior.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tony_angelopoulosCommented:
check out this tutorial to see what I am talking about:

http://msdn.microsoft.com/en-us/library/bb288032.aspx
0
eddie1747Author Commented:
Creating a seperate template has solved this issue. Many thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.