Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default DataGridView

    I'm trying to format a DateTime bound column with the new DataGridView in
    VS2005.

    I set the DataFormatString to "{0:d}" (which should give me the date only)
    and I get the general format (including time). None of the possible
    formatting options seems to make a difference.

    Formatting a numeric column seems to work fine.

    Any ideas?


    Jasper Kent Guest

  2. Similar Questions and Discussions

    1. How to establish connection of DataGridView Control to Stock Excha
      Dear Sir, I m develop a application in vb.net which update a live prices of stocks by a website named (www.nseindia.com) i m using...
    2. ComboBox column in DataGridView
      This isn't exactly about DataGrid. It's about DataGridView, but I'm hoping this newsgroup is close enough. I have a ComboBox type column in a...
  3. #2

    Default Re: DataGridView

    In BETA 2 of Visual studio that worked, I don't understand while at release
    someone changed it. Anyway, you have to set the htmlEncode of the bound
    column to false:

    <asp:BoundField DataField="DateOfBirth" DataFormatString="{0:MM/dd/yyyy}"
    HtmlEncode="false"/>

    Hope this helps

    Jasper Kent wrote:
    >I'm trying to format a DateTime bound column with the new DataGridView in
    >VS2005.
    >
    >I set the DataFormatString to "{0:d}" (which should give me the date only)
    >and I get the general format (including time). None of the possible
    >formatting options seems to make a difference.
    >
    >Formatting a numeric column seems to work fine.
    >
    >Any ideas?
    --
    Brian Hammil
    "Peace for Life.....Natrual Spring...."
    After the several shots of Tequila it
    sounded profound!
    Brian Hammil Guest

  4. #3

    Default Re: DataGridView

    Easy once you know how - many thanks.

    "Brian Hammil" <u15915@uwe> wrote in message news:57a1fb3706a56@uwe...
    > In BETA 2 of Visual studio that worked, I don't understand while at
    > release
    > someone changed it. Anyway, you have to set the htmlEncode of the bound
    > column to false:
    >
    > <asp:BoundField DataField="DateOfBirth" DataFormatString="{0:MM/dd/yyyy}"
    > HtmlEncode="false"/>
    >
    > Hope this helps
    >
    > Jasper Kent wrote:
    >>I'm trying to format a DateTime bound column with the new DataGridView in
    >>VS2005.
    >>
    >>I set the DataFormatString to "{0:d}" (which should give me the date only)
    >>and I get the general format (including time). None of the possible
    >>formatting options seems to make a difference.
    >>
    >>Formatting a numeric column seems to work fine.
    >>
    >>Any ideas?
    >
    > --
    > Brian Hammil
    > "Peace for Life.....Natrual Spring...."
    > After the several shots of Tequila it
    > sounded profound!

    Jasper Kent 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