How do I format my GridView bound column differently?

Replace the ColumnName value with the name of your column.

Replace DataFormatString property with the format string of your choosing.  A good reference for .NET string formats is available at http://john-sheehan.com/blog/index.php/net-cheat-sheets/

<asp :GridView ID=“GridView1″ runat=“server”>
    <columns>
        <asp :BoundField DataField=ColumnName
            DataFormatString={0:M-dd-yyyy}
            HtmlEncode=false
            HeaderText=ColumnName />

        </columns>
</asp:GridView>

%d bloggers like this: