Sorting RadClientDataSource

4 posts, 0 answers
  1. Richard
    Richard avatar
    28 posts
    Member since:
    Sep 2011

    Posted 03 May 2018 Link to this post

    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

     

     

  2. Eyup
    Admin
    Eyup avatar
    3866 posts

    Posted 08 May 2018 Link to this post

    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.
  3. Richard
    Richard avatar
    28 posts
    Member since:
    Sep 2011

    Posted 09 May 2018 in reply to Eyup Link to this post

    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

  4. Eyup
    Admin
    Eyup avatar
    3866 posts

    Posted 14 May 2018 Link to this post

    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.
Back to Top