Text Format String - Please help

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Text Format String - Please help

    Hi,

    I need to display a DateTime field in 'mm/dd/yyyy' in a DataGrid.. On
    myGrid1 - Properties - Columns - myColumn1 - Text format string:

    I tried to put 'mm/dd/yyyy' in there and it displays 'mm/dd/yyyy' in stead
    of '04/10/2001'. I know I didn't do it right. Please let me know what's the
    correct way to display a 'mm/dd/yyyy' format for a DateTime coulmn.

    Thanks.

    Eddy


    Eddy Soeparmin Guest

  2. Similar Questions and Discussions

    1. URL FOrmat String
      Hi I am trying to learn about asp.net and I have come across the following problem. In DataGrid Columns URL format string box is not...
    2. Format Phone Number String in Datagrid Column
      Greetings, I have a 10 digit phone number stored as a string in a SQL server table. My datagrid currently displays it as 1234567890, but I would...
    3.   is not generated for null values when using a format string
      I have a DataGrid with which formats dates <ASP:TEMPLATECOLUMN SortExpression="EST_DATE" HeaderText="Est Date"> <ITEMTEMPLATE> <ASP:LABEL...
    4. format string
      Just a little question... How do I split 12345678 into 12 34 56 78??????? Christopher Brandsdal
    5. Using string format
      I have a question about the string formatting function. I have a field in a database that is coming back as a 6 digit date: 061503 I would...
  3. #2

    Default Re: Text Format String - Please help

    make sure ur page Culture is set right
    "Eddy Soeparmin" <esoeparmin@clientprofiles.com> wrote in message
    news:udPQR07RDHA.2008@TK2MSFTNGP11.phx.gbl...
    > Hi,
    >
    > I need to display a DateTime field in 'mm/dd/yyyy' in a DataGrid.. On
    > myGrid1 - Properties - Columns - myColumn1 - Text format string:
    >
    > I tried to put 'mm/dd/yyyy' in there and it displays 'mm/dd/yyyy' in stead
    > of '04/10/2001'. I know I didn't do it right. Please let me know what's
    the
    > correct way to display a 'mm/dd/yyyy' format for a DateTime coulmn.
    >
    > Thanks.
    >
    > Eddy
    >
    >

    Vincent V Guest

  4. #3

    Default Re: Text Format String - Please help

    Hi Vincent,
    > make sure ur page Culture is set right
    I don't really understand what you mean by that, would you please explain
    more specific in detail? I'm very new in this area. Is there something that
    I have to do in VS.Net? or IE? Please advice.

    Thanks.

    "Vincent V" <vincentv@-n0-5pam-optushome.com.au> wrote in message
    news:O6fD6H8RDHA.304@tk2msftngp13.phx.gbl...
    > make sure ur page Culture is set right
    > "Eddy Soeparmin" <esoeparmin@clientprofiles.com> wrote in message
    > news:udPQR07RDHA.2008@TK2MSFTNGP11.phx.gbl...
    > > Hi,
    > >
    > > I need to display a DateTime field in 'mm/dd/yyyy' in a DataGrid.. On
    > > myGrid1 - Properties - Columns - myColumn1 - Text format string:
    > >
    > > I tried to put 'mm/dd/yyyy' in there and it displays 'mm/dd/yyyy' in
    stead
    > > of '04/10/2001'. I know I didn't do it right. Please let me know what's
    > the
    > > correct way to display a 'mm/dd/yyyy' format for a DateTime coulmn.
    > >
    > > Thanks.
    > >
    > > Eddy
    > >
    > >
    >
    >

    Eddy Soeparmin Guest

  5. #4

    Default Text Format String - Please help

    Eddy,

    I found myself having this problem the other day and
    couldn't find any documentation in the MSDN other than for
    numbers. Here is what you need to put in the format
    string:

    {0:mm/dd/yyyy}

    Also,

    [url]http://asp.net/[/url] is a really good site for anything related
    to ASP .NET or .NET in general. The people in the Forums
    there are very helpful and usually can answer my questions
    within an hour.


    >-----Original Message-----
    >Hi,
    >
    >I need to display a DateTime field in 'mm/dd/yyyy' in a
    DataGrid.. On
    >myGrid1 - Properties - Columns - myColumn1 - Text format
    string:
    >
    >I tried to put 'mm/dd/yyyy' in there and it
    displays 'mm/dd/yyyy' in stead
    >of '04/10/2001'. I know I didn't do it right. Please let
    me know what's the
    >correct way to display a 'mm/dd/yyyy' format for a
    DateTime coulmn.
    >
    >Thanks.
    >
    >Eddy
    >
    >
    >.
    >
    Brian Smith Guest

  6. #5

    Default RE: Text Format String - Please help

    Vincent,
    Try using the format "{0:MM/dd/yyyy}". Also, check the Help section within
    the DataGrid Property Builder dialog box. It will provide you with more
    information about the format modifiers.

    Charlie Nilsson [msft]
    Visual Studio Update

    --

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Use of included script samples are subject to the terms specified at
    [url]http://www.microsoft.com/info/cpyright.htm[/url]

    Note: For the benefit of the community-at-large, all responses to this
    message are best directed to the newsgroup/thread from which they
    originated.
    --------------------
    > From: "Eddy Soeparmin" <esoeparmin@clientprofiles.com>
    > Subject: Text Format String - Please help
    > Date: Fri, 11 Jul 2003 11:03:09 -0400
    > Lines: 14
    > X-Priority: 3
    > X-MSMail-Priority: Normal
    > X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    > X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    > Message-ID: <udPQR07RDHA.2008@TK2MSFTNGP11.phx.gbl>
    > Newsgroups: microsoft.public.dotnet.framework.aspnet
    > NNTP-Posting-Host: adsl-065-083-137-202.sip.asm.bellsouth.net
    65.83.137.202
    > Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
    > Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:158558
    > X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    >
    > Hi,
    >
    > I need to display a DateTime field in 'mm/dd/yyyy' in a DataGrid.. On
    > myGrid1 - Properties - Columns - myColumn1 - Text format string:
    >
    > I tried to put 'mm/dd/yyyy' in there and it displays 'mm/dd/yyyy' in stead
    > of '04/10/2001'. I know I didn't do it right. Please let me know what's
    the
    > correct way to display a 'mm/dd/yyyy' format for a DateTime coulmn.
    >
    > Thanks.
    >
    > Eddy
    >
    >
    >
    Charlie Nilsson [MSFT] Guest

  7. #6

    Default Re: Text Format String - Please help

    Thanks Brian, Charlie,

    When applying that format, it displays 00/09/1999 instead of 07/09/1999. I
    will look at the [url]http://asp.net/[/url] and DataGrid Property Builder dialog box.

    Eddy

    "Charlie Nilsson [MSFT]" <CharlieNilsson_CUTOUT_@hotmail.com> wrote in
    message news:N6MXH28RDHA.1616@cpmsftngxa06.phx.gbl...
    > Vincent,
    > Try using the format "{0:MM/dd/yyyy}". Also, check the Help section
    within
    > the DataGrid Property Builder dialog box. It will provide you with more
    > information about the format modifiers.
    >
    > Charlie Nilsson [msft]
    > Visual Studio Update
    >
    > --
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    rights.
    > Use of included script samples are subject to the terms specified at
    > [url]http://www.microsoft.com/info/cpyright.htm[/url]
    >
    > Note: For the benefit of the community-at-large, all responses to this
    > message are best directed to the newsgroup/thread from which they
    > originated.
    > --------------------
    > > From: "Eddy Soeparmin" <esoeparmin@clientprofiles.com>
    > > Subject: Text Format String - Please help
    > > Date: Fri, 11 Jul 2003 11:03:09 -0400
    > > Lines: 14
    > > X-Priority: 3
    > > X-MSMail-Priority: Normal
    > > X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    > > X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    > > Message-ID: <udPQR07RDHA.2008@TK2MSFTNGP11.phx.gbl>
    > > Newsgroups: microsoft.public.dotnet.framework.aspnet
    > > NNTP-Posting-Host: adsl-065-083-137-202.sip.asm.bellsouth.net
    > 65.83.137.202
    > > Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
    > > Xref: cpmsftngxa06.phx.gbl
    microsoft.public.dotnet.framework.aspnet:158558
    > > X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    > >
    > > Hi,
    > >
    > > I need to display a DateTime field in 'mm/dd/yyyy' in a DataGrid.. On
    > > myGrid1 - Properties - Columns - myColumn1 - Text format string:
    > >
    > > I tried to put 'mm/dd/yyyy' in there and it displays 'mm/dd/yyyy' in
    stead
    > > of '04/10/2001'. I know I didn't do it right. Please let me know what's
    > the
    > > correct way to display a 'mm/dd/yyyy' format for a DateTime coulmn.
    > >
    > > Thanks.
    > >
    > > Eddy
    > >
    > >
    > >
    >

    Eddy Soeparmin Guest

  8. #7

    Default Re: Text Format String - Please help

    Hi Brian,

    I finally get it to work now. Earlier I got 00/09/1999 instead of 07/09/1999
    because I'm using {0:mm/dd/yyyy}. It's case sensitive, and it must be
    {0:MM/dd/yyyy}.

    Thanks.

    Eddy

    "Brian Smith" <smitho@mantech-wva.com> wrote in message
    news:074e01c347cc$f65bfcf0$a001280a@phx.gbl...
    > Eddy,
    >
    > I found myself having this problem the other day and
    > couldn't find any documentation in the MSDN other than for
    > numbers. Here is what you need to put in the format
    > string:
    >
    > {0:mm/dd/yyyy}
    >
    > Also,
    >
    > [url]http://asp.net/[/url] is a really good site for anything related
    > to ASP .NET or .NET in general. The people in the Forums
    > there are very helpful and usually can answer my questions
    > within an hour.
    >
    >
    >
    > >-----Original Message-----
    > >Hi,
    > >
    > >I need to display a DateTime field in 'mm/dd/yyyy' in a
    > DataGrid.. On
    > >myGrid1 - Properties - Columns - myColumn1 - Text format
    > string:
    > >
    > >I tried to put 'mm/dd/yyyy' in there and it
    > displays 'mm/dd/yyyy' in stead
    > >of '04/10/2001'. I know I didn't do it right. Please let
    > me know what's the
    > >correct way to display a 'mm/dd/yyyy' format for a
    > DateTime coulmn.
    > >
    > >Thanks.
    > >
    > >Eddy
    > >
    > >
    > >.
    > >

    Eddy Soeparmin Guest

  9. #8

    Default Re: Text Format String - Please help

    "Eddy Soeparmin" <esoeparmin@clientprofiles.com> wrote in message news:<udPQR07RDHA.2008@TK2MSFTNGP11.phx.gbl>...
    > Hi,
    >
    > I need to display a DateTime field in 'mm/dd/yyyy' in a DataGrid.. On
    > myGrid1 - Properties - Columns - myColumn1 - Text format string:
    >
    > I tried to put 'mm/dd/yyyy' in there and it displays 'mm/dd/yyyy' in stead
    > of '04/10/2001'. I know I didn't do it right. Please let me know what's the
    > correct way to display a 'mm/dd/yyyy' format for a DateTime coulmn.
    >
    > Thanks.
    >
    > Eddy
    try {0:d} in the datafomatstring property

    John
    John G Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139