Results 1 to 2 of 2

Thread: Datagrid Itemtemplate date US and Europe format

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    38

    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.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width