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

[Solved] Removing the ability to remove a sort

4 Answers 129 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michael MSTG
Top achievements
Rank 1
Michael MSTG asked on 11 Nov 2010, 11:07 PM
Is there any way to prevent the user from doing the 3-sort click that removes any sorting on that column?  We are using a domain data source to load the data and came across the issue where if you do the 3-click sort on a column, on the 3rd click the sort descriptor is removed.  The problem with this is if you have paging enabled and specified a load size, when the DDS attempts to load the next set of records, you get the following error:
"The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'."

One solution we know is simply to perform an order by on every single "get" RIA service method but we shouldn't have to if we've applied the sort to begin with.

Is there no way to ensure if there is a sort applied we ensure the user cannot remove it?

4 Answers, 1 is accepted

Sort by
0
Michael MSTG
Top achievements
Rank 1
answered on 15 Nov 2010, 04:47 PM
bump...
0
Accepted
Vanya Pavlova
Telerik team
answered on 15 Nov 2010, 04:55 PM
Hello Michael,

You can try to implement your custom logic in RadGriView's sorting event handler in this way:

private void grid_Sorting (object sender, Telerik.Windows.Controls.GridViewSortingEventArgs e)
{
   if (e.NewSortingState == SortingState.None)
   {
    e.NewSortingState = SortingState.Ascending;
   }
}

Using this piece of code you can sort columns in either Ascending or Descending order.


Best wishes,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Michael MSTG
Top achievements
Rank 1
answered on 15 Nov 2010, 05:06 PM
I've marked that as a solution because it does work however it would be great if this was a property that could be set in the XAML (i.e. something like AllowRemoveSort or AllowThreeClickSort with a default to true).  Can that be set up as a new feature for a future release?
0
Vanya Pavlova
Telerik team
answered on 15 Nov 2010, 06:23 PM
Hi Michael,


Thank you for your feedback, I have logged your request in our Public Issue Tracking System and you can vote for implementing it in any future release from here.


Greetings,
Vanya Pavlova
the Telerik team
See What's New in RadControls for Silverlight in Q3 2010 on Tuesday, November 16, 2010 11:00 AM - 12:00 PM EST or 10:00 PM - 11:00 PM EST: Register here>>
Tags
GridView
Asked by
Michael MSTG
Top achievements
Rank 1
Answers by
Michael MSTG
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or