how to get a short-date with gridview?

Discussion in 'ASP .Net Web Controls' started by Dan, May 23, 2006.

  1. Dan

    Dan Guest

    Hi,

    I defined a gridview which must fetch a date field in Access. In the table,
    the date are e.g. 05/06/2006, but the gridview gives 05/06/2006 0:00:00.

    I couldn't find the property to get the short date.

    Thanks
    Dan
     
    Dan, May 23, 2006
    #1
    1. Advertising

  2. Dan

    Jan Hyde Guest

    "Dan" <>'s wild thoughts were released on Tue, 23
    May 2006 13:08:49 +0200 bearing the following fruit:

    >Hi,
    >
    >I defined a gridview which must fetch a date field in Access. In the table,
    >the date are e.g. 05/06/2006, but the gridview gives 05/06/2006 0:00:00.
    >
    >I couldn't find the property to get the short date.
    >


    Set the DataFormatString to the format you want, eg mine is
    set to {0:d}

    Then switch off HTMLEncode on that column.



    Jan Hyde (VB MVP)

    --
    Have you heard about the new airline for old people?
    Its called Incontinental. (Richard Lederer)
     
    Jan Hyde, May 25, 2006
    #2
    1. Advertising

  3. Dan

    Dan Guest

    Thanks.
    Is it possible to do that in the code-behind page (directly in vb.net )?


    "Jan Hyde" <> wrote in message
    news:...
    > "Dan" <>'s wild thoughts were released on Tue, 23
    > May 2006 13:08:49 +0200 bearing the following fruit:
    >
    > >Hi,
    > >
    > >I defined a gridview which must fetch a date field in Access. In the

    table,
    > >the date are e.g. 05/06/2006, but the gridview gives 05/06/2006 0:00:00.
    > >
    > >I couldn't find the property to get the short date.
    > >

    >
    > Set the DataFormatString to the format you want, eg mine is
    > set to {0:d}
    >
    > Then switch off HTMLEncode on that column.
    >
    >
    >
    > Jan Hyde (VB MVP)
    >
    > --
    > Have you heard about the new airline for old people?
    > Its called Incontinental. (Richard Lederer)
    >
     
    Dan, May 27, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,279
    Michael Borgwardt
    May 30, 2004
  2. David Geering

    longs, long longs, short short long ints . . . huh?!

    David Geering, Jan 8, 2007, in forum: C Programming
    Replies:
    15
    Views:
    565
    Keith Thompson
    Jan 11, 2007
  3. Replies:
    4
    Views:
    831
    Kaz Kylheku
    Oct 17, 2006
  4. Ioannis Vranos

    unsigned short, short literals

    Ioannis Vranos, Mar 4, 2008, in forum: C Programming
    Replies:
    5
    Views:
    684
    Eric Sosman
    Mar 5, 2008
  5. Andre
    Replies:
    5
    Views:
    542
    Keith Thompson
    Jul 17, 2012
Loading...

Share This Page