formatting a date field in a datagrid colum - newbie

R

RP

I'm working with a datagrid control and needing to format a date field(from
access) so that it just has dd/mm. Do I format it in the Tag or in my
OnItemDataBoundEventHandler (or similar). I was looking at the
DataFormatString parameter but couldn't get that to affect the data.
Thanks
Rich
 
J

Jim Blizzard [MSFT]

You could have more control over the formatting by using the standard
DateTime format strings in the OnItemDataBound event handler. See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconstandarddatetimeformatstringsoutputexample.asp for info about
formatting date strings.

Hope this helps,
bliz

--
Jim Blizzard
Sr .NET Developer Evangelist
Microsoft

Your Potential. Our Passion.

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only, so that others may benefit. Thanks.


--------------------
 
D

David Waz...

You can set the format using the 'Data Formatting
Expression:' field in the property builder for the column:
{0:dd/mm}
email if you need more...
 
R

RP

Thanks. I used the {0:dd/mm/yy} string in the property builder.

Have a great 4th weekend.

Rich
 
R

RP

Thanks. I used the {0:dd/mm/yy} string in the property builder.

Have a great 4th weekend.

Rich
 

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,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top