formatting a date field in a datagrid colum - newbie

  • Thread starter Thread starter RP
  • Start date Start date
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
 
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.


--------------------
 
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...
 
Thanks. I used the {0:dd/mm/yy} string in the property builder.

Have a great 4th weekend.

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

Have a great 4th weekend.

Rich
 
Back
Top