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

sort a column via HeaderContextMenu

6 Answers 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul Evers
Top achievements
Rank 2
Paul Evers asked on 15 Oct 2013, 01:57 PM
Hi,

I have a RadGrid implemented where I use a column in the dataset that is not shown to sort a column (Quality_Sort) that is shown in the RadGrid.
I do this by assigning the 'sort'-column to the sortexpression of the boundcolumn.
boundColumn.SortExpression = "Quality_Sort";

The GridBoundColumn can have value 'Low', 'Medium' and 'High'.
In the column 'Quality_Sort' these values are represented as 1, 2 and 3.

When I click on the header of the column the sorting works as expected ('Low' > 'Medium' > 'High'). When I select the option 'Sort Ascending' from the headercontextmenu the sorting will result in an alphabetical sorting ('High' > 'Low' > 'Medium').

Is this a bug?

Paul

6 Answers, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 18 Oct 2013, 09:26 AM
Hello,

 You can handle the ItemCommand of the grid check the what sort expression is assigned in each case. If necessary you can modify the sort expression and rebind the control to achieve the desired sorting.
Generally sorting from the header context menu should result in the same sort expression assinged to the grid.

Regards,
Marin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Paul Evers
Top achievements
Rank 2
answered on 18 Oct 2013, 09:35 AM
As the sorting from the header context menu does NOT result in the same sort expression assigned I conclude this is a bug.

When will this be solved?

Paul
0
Marin
Telerik team
answered on 18 Oct 2013, 10:00 AM
Hello,

 Are both types of sorting (header and header context menu) targeted towards the same field in the datasource?
It will be helpful if you can send us a sample runnable project so we can check it on our side and let you know if this is an issue with the control or problem with the setup.

Regards,
Marin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Paul Evers
Top achievements
Rank 2
answered on 18 Oct 2013, 10:32 AM
I cannot upload upload a zip-file.
(Reply to thread cannot be created because:
  • Please upload valid files: .gif,.jpg,.jpeg,.png smaller than 2MB.)


Paul
0
Marin
Telerik team
answered on 18 Oct 2013, 10:38 AM
Hello,

 If the file is larger than 2 MB you can open a support ticket and attach it there or if you prefer you can upload it to a file sharing web site and provide the link to download it from there.

Regards,
Marin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Paul Evers
Top achievements
Rank 2
answered on 18 Oct 2013, 11:06 AM
I have added the test application to the ticked 748535.

(zip files are not allowed here, even when the size is 23kB).

Paul
Tags
Grid
Asked by
Paul Evers
Top achievements
Rank 2
Answers by
Marin
Telerik team
Paul Evers
Top achievements
Rank 2
Share this question
or