Sort in saved layout does not work

3 posts, 0 answers
  1. Grant Fish
    Grant Fish avatar
    10 posts
    Member since:
    Apr 2010

    Posted 17 May 2011 Link to this post

    If a sort is saved as part of a layout it is not honored when the layout is loaded. The column header has the sort indicator (black triangle indicating ascending/descending), but the data appears in the order of the underlying data source, not the order specified in the layout.

    If I click on the column header the data is sorted, but the sort added as part of the layout definition is ignored. It almost seems as though there is some sort of "apply" method that needs to be called.

    I believe that this worked in 2010Q1, but is broken in 2011Q1.
  2. Grant Fish
    Grant Fish avatar
    10 posts
    Member since:
    Apr 2010

    Posted 17 May 2011 Link to this post

    I stumbled across the solution to this problem. Because custom sorting is now defined at the template level rather than the column level, I had the AllowCustomSorting turned on because I needed custom sorting on one column. My custom sorting delegate only dealt with the contents of this one column.
    I am using the SortChanged event to turn custom sorting on and off depending on whether my one column that requires custom sorting is being sorted, but the SortChanged event does not fire when the layout is loaded.

    By disabling custom sorting by default I was able to solve my problem.
  3. Martin Vasilev
    Martin Vasilev avatar
    1061 posts

    Posted 20 May 2011 Link to this post

    Hello Grant Fish,

    Thank you for writing.

    I am glad you have found solution for your case. However, I have checked the described scenario and both SortChanged and CustomSorting events are thrown on layout loading. Without any additional information or/and source code I cannot be sure what caused the issue in your project. Please, could you send me your project. This will help me to investigate further this issue.

    I look forward to your reply.

    Martin Vasilev
    the Telerik team
    Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
Back to Top