Change default sorting for fields added at runtime

3 posts, 1 answers
  1. Edwin
    Edwin avatar
    4 posts
    Member since:
    May 2014

    Posted 04 Jun 2014 Link to this post

    Hi,

    Is it possible to programmatically change the default sorting for fields that are added through a RadPivotFieldList?  Currently added fields have default sorting of Ascending (A to Z), but I would like to have no sorting.

    Thanks,
    Edwin
  2. Answer
    Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 05 Jun 2014 Link to this post

    Hello Edwin,

    What I can suggest you would be to subscribe to the PrepareDescriptionForField event of the DataSourceProvider and set the SortOrder of the new Description to None in the event handler the following way:

    private void LocalDataSourceProvider_PrepareDescriptionForField(object sender, PrepareDescriptionForFieldEventArgs e)
    {
        if (e.DescriptionType == DataProviderDescriptionType.Group)
        {
            (e.Description as PropertyGroupDescriptionBase).SortOrder = SortOrder.None;
        }
    }

    Hope this helps.

    Regards,
    Kalin
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Edwin
    Edwin avatar
    4 posts
    Member since:
    May 2014

    Posted 05 Jun 2014 in reply to Kalin Link to this post

    Hi Kalin,

    Thanks for the example.  Tested and confirmed to do what I needed.

    Regards,
    Edwin
Back to Top