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

Custom sorting

3 Answers 139 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Missing User
Missing User asked on 22 May 2011, 09:35 AM
For the sake of the others, please update your custom sorting guide to include IsCustomSortingEnabled on the columns. I spent almost a day figuring out why the sorting didn't work anymore (It sorts once but the NewSortingState property doesn't stick). This is very frustrating and is nowhere mentioned as a requirement.

3 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 23 May 2011, 09:15 AM
Hi Marcel,

 

Thank you for your feedback! We are constantly working on the improvement of our online documentation and the help articles contained in it. Furthermore you may also use our API reference where you may find everything you need about any RadControl.  


Regards,
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
Jessica
Top achievements
Rank 1
answered on 29 Feb 2012, 10:00 PM
I am having the same problem as this. On the data loaded event I did the following
foreach(var column in dataGridView.Columns)
          {
              column.IsCustomSortingEnabled = true;
          }

but after performing my custom sort the NewSortingState doesn't persist? Any other ideas?
Here is my sort

private void dataGridView_Sorting(object sender, GridViewSortingEventArgs e)
    {
        //Checks if the value of the collection is null.
        if (CurrentDataTable == null)
        {
            e.Cancel = true;
            return;
        }
        if (e.OldSortingState == SortingState.None)
        {
            e.NewSortingState = SortingState.Ascending;
            SortASC(e.SortPropertyName);
        }
        else if (e.OldSortingState == SortingState.Ascending)
        {
            e.NewSortingState = SortingState.Descending;
            SortDESC(e.SortPropertyName);
        }
        else if(e.OldSortingState == SortingState.Descending)
        {
            e.NewSortingState = SortingState.None;
            ClearSort();
        }
         
        e.Cancel = true; 
    }
0
Vlad
Telerik team
answered on 01 Mar 2012, 08:19 AM
Hello,

 Can you post more info about your version? I've checked our demo and everything worked properly. 

Kind regards,
Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
GridView
Asked by
Missing User
Answers by
Vanya Pavlova
Telerik team
Jessica
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or