Formatting grid view columns

Discussion in 'ASP .Net' started by John, Jun 3, 2008.

  1. John

    John Guest

    Hi

    I have a gridview bound to a sql server table. Two of the gridview columns
    are bound to datetime fields. Is there a way to format one of those columns
    to show only date part and the other column to show only time part?

    Thanks

    Regards
    John, Jun 3, 2008
    #1
    1. Advertising

  2. John

    Munna Guest

    On Jun 3, 8:53 am, "John" <> wrote:
    > Hi
    >
    > I have a gridview bound to a sql server table. Two of the gridview columns
    > are bound to datetime fields. Is there a way to format one of those columns
    > to show only date part and the other column to show only time part?
    >
    > Thanks
    >
    > Regards


    Hi

    For this you can solve the problem by setting DataFormatString of the
    boundColumn
    Go to gridviewtask
    and select edit column
    select the column you want to edit and navigate to DataFormatString
    and set
    {0:dd/MM/yyyy} to get the date part only

    you can follow this thread for more info

    http://forums.asp.net/p/1023473/2244968.aspx

    Best of luck

    Munna
    www.munna.shatkotha.com
    www.munna.shatkotha.com/blog
    www.shatkotha.com
    Munna, Jun 3, 2008
    #2
    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. Luqman
    Replies:
    2
    Views:
    3,796
    Luqman
    Feb 1, 2006
  2. =?Utf-8?B?Z2FuZQ==?=
    Replies:
    2
    Views:
    549
    Bruno Alexandre
    Feb 16, 2007
  3. wahtnamas
    Replies:
    0
    Views:
    880
    wahtnamas
    May 1, 2009
  4. ton
    Replies:
    2
    Views:
    200
    Alvin Bruney [MVP]
    Feb 11, 2004
  5. IRA

    ASP.NET Grid view formatting

    IRA, Sep 25, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    101
Loading...

Share This Page