This is a migrated thread and some comments may be shown as answers.

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

1 Answer 66 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 26 Jan 2016, 11:18 AM

Hi,

 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">
                <ClientSettings>
                    <Selecting AllowRowSelect="True" />
                </ClientSettings>
                    <MasterTableView DataSourceID="ObjectDataSource1" AutoGenerateColumns="False">
                        <Columns>
                            <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>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
                <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.

 

 

1 Answer, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
Iron
Veteran
Iron
answered on 26 Jan 2016, 06:21 PM
I do not see you using the "SortExpression" attribute.  With that attribute you can display one thing but sort off another.
Tags
General Discussions
Asked by
Thomas
Top achievements
Rank 1
Answers by
David
Top achievements
Rank 1
Iron
Veteran
Iron
Share this question
or