ASP.NET RadGrid with date dd/mm/yyyy hh:mm:ss

2 posts, 0 answers
  1. Thomas
    Thomas avatar
    3 posts
    Member since:
    Sep 2015

    Posted 26 Jan Link to this post


     The problem is that my date is like "31/12/2015 11:45:00" and i want be able to sorting and filtering on this date.

     Here is the code:


                    <telerik:RadGrid ID="Grid_ID" runat="server" DataSourceID="ObjectDataSource1" GroupPanelPosition="Top" AllowSorting="true" AllowFilteringByColumn="true">
                        <Selecting AllowRowSelect="True" />
                        <MasterTableView DataSourceID="ObjectDataSource1" AutoGenerateColumns="False">
                                <telerik:GridBoundColumn DataField="Code" HeaderText="Code"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Num_article" HeaderText="Num. article"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Description" HeaderText="Description"></telerik:GridBoundColumn>
                                <telerik:GridDateTimeColumn DataField="Date" HeaderText="Date" DataFormatString="{0:d}" FilterDateFormat="dd/MM/yyyy"></telerik:GridDateTimeColumn>
                    <asp:ObjectDataSource runat="server" ID="ObjectDataSource1" SelectMethod="SP_RECORD_GET" TypeName="DA_Record"></asp:ObjectDataSource>


    De sorting is on "string value" and i want he sort on de DATE.

    Thanks for your help.


  2. David
    David avatar
    89 posts
    Member since:
    Jan 2011

    Posted 26 Jan in reply to Thomas Link to this post

    I do not see you using the "SortExpression" attribute.  With that attribute you can display one thing but sort off another.
  3. DevCraft R3 2016 release webinar banner
Back to Top