468,247 Members | 1,338 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,247 developers. It's quick & easy.

In datagrid, how do you format a date?

How do I set up date formating for a column in a DataGrid Web Control?

I have one column in an ASP.Net data grid that contains a date. It is
showing date and time, which I don't want. I only want the date. I
set up the grid using the walkthrough that uses the dataadapter, and
dataconnection from the toolbox and then genertates the data set using
the wizard, so I don't have much code that I can alter.

Jun 7 '06 #1
1 1007
This should do the trick:

DataFormatString="{0:MM/dd/yyyy}"

======================================
David McCarter
www.vsdntips.com
VSDN Tips & Tricks .NET Coding Standards available at:
www.cafepress.com/vsdntips.20412485
"to******@gmail.com" wrote:
How do I set up date formating for a column in a DataGrid Web Control?

I have one column in an ASP.Net data grid that contains a date. It is
showing date and time, which I don't want. I only want the date. I
set up the grid using the walkthrough that uses the dataadapter, and
dataconnection from the toolbox and then genertates the data set using
the wizard, so I don't have much code that I can alter.

Jun 9 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Andrew S. Giles | last post: by
7 posts views Thread by Matthew Wieder | last post: by
1 post views Thread by J.B | last post: by
4 posts views Thread by Paul | last post: by
5 posts views Thread by William Gower | last post: by
4 posts views Thread by yer darn tootin | last post: by
4 posts views Thread by hope | last post: by
14 posts views Thread by Brett Sinclair | last post: by
2 posts views Thread by John Dann | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.