Format Date in BoundField

Discussion in 'ASP .Net Datagrid Control' started by stefanjohansson_2005@yahoo.se, Dec 8, 2006.

  1. Guest

    I have the code below to display and format a date column in a
    GridView. This works when the GridView is in read mode. But when I
    select Edit the date is no longer formated with DataFormatString. What
    should I do?

    <asp:BoundField DataField="StartDate" HeaderText="StartDate"
    SortExpression="StartDate" DataFormatString="{0:d}" HtmlEncode="False"
    />
     
    , Dec 8, 2006
    #1
    1. Advertising

  2. Guest

    Found it! There is another setting called ApplyFormatInEditMode.

    skrev:

    > I have the code below to display and format a date column in a
    > GridView. This works when the GridView is in read mode. But when I
    > select Edit the date is no longer formated with DataFormatString. What
    > should I do?
    >
    > <asp:BoundField DataField="StartDate" HeaderText="StartDate"
    > SortExpression="StartDate" DataFormatString="{0:d}" HtmlEncode="False"
    > />
     
    , Dec 12, 2006
    #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. Brian Candy
    Replies:
    2
    Views:
    1,172
    Janaka
    Feb 18, 2004
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,278
    Michael Borgwardt
    May 30, 2004
  3. Chu
    Replies:
    3
    Views:
    4,193
    Shawn
    Aug 15, 2006
  4. Adam Right
    Replies:
    2
    Views:
    473
    Adam Right
    Feb 12, 2008
  5. Josh Sharpe
    Replies:
    1
    Views:
    212
    Brian Candler
    Sep 21, 2010
Loading...

Share This Page