Datagrid Itemtemplate date US and Europe format
I am looking for a condition under itemtemplate column to send the date format:
I want to pass this"dd/mm/yyyy" or "mm/dd/yyyy" value via
session("datelocale")
*****************************************************
<ItemTemplate>
<%# trim(DataBinder.Eval(Container.DataItem,"eventdate","{0:MM/dd/yyyy}")) %>
</ItemTemplate>
*****************************************************
Thank you very much for the information.
Re: Datagrid Itemtemplate date US and Europe format
Is there a problem?
If you were doing this in the codebehind, you would use datetimeobject.tostring("theformathere") where you could specify the condition to be used.
You could also create a method in your codebehind that does this and make a call to it from your itemtemplate from above.
Code:
<ItemTemplate>
<%# MyDateTimeConverter(DataBinder.Eval(Container.DataItem,"eventdate","{0:MM/dd/yyyy}")) %>
</ItemTemplate>