Text Format String - Please help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eddy Soeparmin

    #1

    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


  • Vincent V

    #2
    Re: Text Format String - Please help

    make sure ur page Culture is set right
    "Eddy Soeparmin" <esoeparmin@cli entprofiles.com > wrote in message
    news:udPQR07RDH A.2008@TK2MSFTN GP11.phx.gbl...[color=blue]
    > 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[/color]
    the[color=blue]
    > correct way to display a 'mm/dd/yyyy' format for a DateTime coulmn.
    >
    > Thanks.
    >
    > Eddy
    >
    >[/color]


    Comment

    • Eddy Soeparmin

      #3
      Re: Text Format String - Please help

      Hi Vincent,
      [color=blue]
      > make sure ur page Culture is set right[/color]
      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.a u> wrote in message
      news:O6fD6H8RDH A.304@tk2msftng p13.phx.gbl...[color=blue]
      > make sure ur page Culture is set right
      > "Eddy Soeparmin" <esoeparmin@cli entprofiles.com > wrote in message
      > news:udPQR07RDH A.2008@TK2MSFTN GP11.phx.gbl...[color=green]
      > > 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[/color][/color]
      stead[color=blue][color=green]
      > > of '04/10/2001'. I know I didn't do it right. Please let me know what's[/color]
      > the[color=green]
      > > correct way to display a 'mm/dd/yyyy' format for a DateTime coulmn.
      > >
      > > Thanks.
      > >
      > > Eddy
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Brian Smith

        #4
        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,

        http://asp.net/ 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.


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

        Comment

        • Charlie Nilsson [MSFT]

          #5
          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
          http://www.microsoft.com/info/cpyright.htm

          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.
          --------------------[color=blue]
          > From: "Eddy Soeparmin" <esoeparmin@cli entprofiles.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.20 08@TK2MSFTNGP11 .phx.gbl>
          > Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
          > NNTP-Posting-Host: adsl-065-083-137-202.sip.asm.bel lsouth.net[/color]
          65.83.137.202[color=blue]
          > Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP11.phx.g bl
          > Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1585 58
          > X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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[/color]
          the[color=blue]
          > correct way to display a 'mm/dd/yyyy' format for a DateTime coulmn.
          >
          > Thanks.
          >
          > Eddy
          >
          >
          >[/color]

          Comment

          • Eddy Soeparmin

            #6
            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 http://asp.net/ and DataGrid Property Builder dialog box.

            Eddy

            "Charlie Nilsson [MSFT]" <CharlieNilsson _CUTOUT_@hotmai l.com> wrote in
            message news:N6MXH28RDH A.1616@cpmsftng xa06.phx.gbl...[color=blue]
            > Vincent,
            > Try using the format "{0:MM/dd/yyyy}". Also, check the Help section[/color]
            within[color=blue]
            > 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[/color]
            rights.[color=blue]
            > Use of included script samples are subject to the terms specified at
            > http://www.microsoft.com/info/cpyright.htm
            >
            > 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.
            > --------------------[color=green]
            > > From: "Eddy Soeparmin" <esoeparmin@cli entprofiles.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.20 08@TK2MSFTNGP11 .phx.gbl>
            > > Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
            > > NNTP-Posting-Host: adsl-065-083-137-202.sip.asm.bel lsouth.net[/color]
            > 65.83.137.202[color=green]
            > > Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP11.phx.g bl
            > > Xref: cpmsftngxa06.ph x.gbl[/color][/color]
            microsoft.publi c.dotnet.framew ork.aspnet:1585 58[color=blue][color=green]
            > > X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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[/color][/color]
            stead[color=blue][color=green]
            > > of '04/10/2001'. I know I didn't do it right. Please let me know what's[/color]
            > the[color=green]
            > > correct way to display a 'mm/dd/yyyy' format for a DateTime coulmn.
            > >
            > > Thanks.
            > >
            > > Eddy
            > >
            > >
            > >[/color]
            >[/color]


            Comment

            • Eddy Soeparmin

              #7
              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@mante ch-wva.com> wrote in message
              news:074e01c347 cc$f65bfcf0$a00 1280a@phx.gbl.. .[color=blue]
              > 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,
              >
              > http://asp.net/ 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.
              >
              >
              >[color=green]
              > >-----Original Message-----
              > >Hi,
              > >
              > >I need to display a DateTime field in 'mm/dd/yyyy' in a[/color]
              > DataGrid.. On[color=green]
              > >myGrid1 - Properties - Columns - myColumn1 - Text format[/color]
              > string:[color=green]
              > >
              > >I tried to put 'mm/dd/yyyy' in there and it[/color]
              > displays 'mm/dd/yyyy' in stead[color=green]
              > >of '04/10/2001'. I know I didn't do it right. Please let[/color]
              > me know what's the[color=green]
              > >correct way to display a 'mm/dd/yyyy' format for a[/color]
              > DateTime coulmn.[color=green]
              > >
              > >Thanks.
              > >
              > >Eddy
              > >
              > >
              > >.
              > >[/color][/color]


              Comment

              • John G

                #8
                Re: Text Format String - Please help

                "Eddy Soeparmin" <esoeparmin@cli entprofiles.com > wrote in message news:<udPQR07RD HA.2008@TK2MSFT NGP11.phx.gbl>. ..[color=blue]
                > 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[/color]

                try {0:d} in the datafomatstring property

                John

                Comment

                Working...