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

Sorting RadClientDataSource

3 Answers 71 Views
ClientDataSource
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Veteran
Richard asked on 03 May 2018, 11:55 PM

I feel like I must be missing something very obvious.  I have this:

<telerik:RadClientDataSource ID="RadClientDataSource1" runat="server" AllowBatchOperations="true" ClientEvents-OnRequestStart="RequestStart" ClientEvents-OnRequestEnd="ResponseEnd">
                    <DataSource>
                        <WebServiceDataSourceSettings>
                            <Select DataType="JSON" />
                        </WebServiceDataSourceSettings>
                    </DataSource>
                    <Schema>
                        <Model ID="DialogIDChecksum">
                            ..
                            <telerik:ClientDataSourceModelField FieldName="ConferenceDateTime" DataType="Date" />
                            ..
                        </Model>
                    </Schema>
                    <SortExpressions>
                        <telerik:ClientDataSourceSortExpression FieldName="ConferenceDateTime" SortOrder="Desc" />
                    </SortExpressions>
                </telerik:RadClientDataSource>

 

And it is tied to a RadGrid.  Everything loads perfectly but it's not sorted.  Is there something special I need to do in the RadGrid so it uses the SortExpressions object in the RadClientDataSource?

Thanks,

Richard

 

 

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 08 May 2018, 04:13 PM
Hi Richard,

Does sorting work as expected upon clicking the column header? Generally, you can try to add the sort expression using dataSource.get_sortExpressions().add method similar to this live demo:
https://demos.telerik.com/aspnet-ajax/clientdatasource/functionality/paging-and-sorting/defaultcs.aspx

If the issue remains, we can prepare a sample RadGrid web site sample to demonstrate how you can achieve that and send it to you.

Looking forward to hearing from you.

Regards,
Eyup
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Richard
Top achievements
Rank 1
Veteran
answered on 09 May 2018, 12:10 PM

Yep, column headers sort exactly as I would expect them to.  Simply not getting the default sort order I want.  I'll try what you posted and report back.

Thanks,

Richard

0
Eyup
Telerik team
answered on 14 May 2018, 07:27 AM
Hello Richard,

Please feel free to take your time to examine the implementation and keep us updated if further assistance is required.

Regards,
Eyup
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ClientDataSource
Asked by
Richard
Top achievements
Rank 1
Veteran
Answers by
Eyup
Telerik team
Richard
Top achievements
Rank 1
Veteran
Share this question
or