DateFormatString not work for Date

2 posts, 0 answers
  1. Amitkumar
    Amitkumar avatar
    66 posts
    Member since:
    Aug 2009

    Posted 24 Dec 2009 Link to this post

    Hi All,

    Not display in date format, what's wrong with follwoing code:

    <telerik:GridBoundColumn AllowFiltering="false" DataField="LoggedInFor"
                                                Display="true" HeaderStyle-Width="7%" HeaderText="Last Login"
                                                UniqueName="LoggedIn" DataFormatString="{0:D}">
                                                <HeaderStyle Width="7%" />
                                            </telerik:GridBoundColumn>


    or

    DataFormatString="{0:MMM/dd/yyyy}"


    Thanks & Regards
    Amit



  2. Amitkumar
    Amitkumar avatar
    66 posts
    Member since:
    Aug 2009

    Posted 24 Dec 2009 Link to this post

    I found my Solution

    I modified your code-snippet:
    <telerik:GridBoundColumn DataField="MyDate" DataType="System.DateTime" HeaderText="Date"
      UniqueName="MyDate" DataFormatString="{0:M/d/yyyy}" HtmlEncode="false"/>

    Note that the data type (in the DB) should be DateTime.



  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top