Date format incorrect on Grid

5 posts, 0 answers
  1. Rodney
    Rodney avatar
    40 posts
    Member since:
    Mar 2015

    Posted 03 Nov Link to this post

    I'm having an issue with date formats on the grid. I've read through lot's of related threads, but they don't seem to be correcting my situation. The date is display as: 11/03/2016T00:00:00

    The page has the column defined as:

    <telerik:GridDateTimeColumn UniqueName="RECORDSTARTDATE" HeaderText="Record Start Date" DataField="RECORDSTARTDATE" ShowFilterIcon="false"
        DataFormatString="{0:dd MMM yyyy}" DataType="System.DateTime" HtmlEncode="false" ItemStyle-CssClass="center"
        CurrentFilterFunction="GreaterThanOrEqualTo" HeaderStyle-Width="120px" />

     

    The DataFormatString is defined as ="{0:dd MMM yyyy}" so my dates not coming out even close.

    Any help would be appreciated.

     

     

     

     

     

     

  2. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 08 Nov Link to this post

    Hi Rodney,

    Generally, the mentioned property should work as expected. Please make sure that the values coming from your database are of type DateTime.

    I am also sending a sample RadGrid web site to demonstrate that.

    Regards,
    Eyup
    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rodney
    Rodney avatar
    40 posts
    Member since:
    Mar 2015

    Posted 08 Nov in reply to Eyup Link to this post

    Actually, the value coming is is just a date using CONVER(date, RECORDSTARTDATE) will this cause the problem I'm seeing? I didn't see just a date datatype for the DataType parameter.
  5. Rodney
    Rodney avatar
    40 posts
    Member since:
    Mar 2015

    Posted 08 Nov in reply to Eyup Link to this post

    Also I didn't see the link to the example. Did I miss it?
  6. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 11 Nov Link to this post

    Hello Rodney,

    Sorry, I've missed to attach the sample. I am re-attaching it to this post.
    Basically, the grid uses default formatting logic, therefore, the values should be DateTime objects:
    https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx
    https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx

    Regards,
    Eyup
    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017