SortDescriptor removed when click on column header

2 posts, 0 answers
  1. Manishkumar
    Manishkumar avatar
    240 posts
    Member since:
    Feb 2009

    Posted 13 Oct 2011 Link to this post

    I am using SortDescriptor  for multi column sorting in TreeListView. My requirement is there is a context menu appearing on columns cells with option like "Sort Ascending" & "SortDescending". When user right click on any cell then i find the corresponding column and add to SortDescriptor. So now when i add the column to SortDescriptor then the column header is highlighted with a small tringle. This is working fine for multiple columns.

    My Problem is suppose I have 10 columns out of which I have added three columns to SortDescriptor and now 3 column header are highlighted. This is done by right click context menu. Now user directly click on 4th column header to sort. In that case the previous 3 columns are removed from SortDescriptor automatically and the user clicked column only highlighted. In my case I need to show all those 4 columns highlighted with 4 values in SortDescriptor. Please help me how I will be able to do.

  2. Ivan Ivanov
    Ivan Ivanov avatar
    1216 posts

    Posted 18 Oct 2011 Link to this post

    Hi Manishkumar,

    I would advise you to disable the default sorting by setting CanUserSortColumns to "False" and try subscribing to GridViewHeaderCell's MouseLeftButtonUp event executing your custom sorting logic in the callback. Please, let me know whether this solution is applicable in your case and do not hesitate to ask us for a code example if you have encountered any obstacles while implementing it.

    Kind regards,
    Ivan Ivanov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top