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

Freezing a particular column from sorting in sortabletelerikGrid

4 Answers 77 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
CHAITHRA
Top achievements
Rank 1
CHAITHRA asked on 19 Aug 2015, 07:22 AM

Hi,

i have sortabletelrik grid with 10 columns.bt default telerik provides sorting option.

i need to customize the sorting facility,i mean ,say i have these two columns with colums1 and columns2. when i click on column header column1,it should not sort.This can be done by setting isortable=false in XAML.But my problem is,wen i click on column2 for sorting,it takes up the first column data for sorting which should not happen. The data of column1 should be freezed wen ever i click on sort on any column header of the grid,it has to exclude coulmn1 and den sort.

Please see the required output in the example.

Ex  before sort

column1  column2

A1           Oligo 1
C1           Oligo 2
F1           Oligo 3
A2           Oligo 4
B2           Oligo 5

After sort

column1  column2
A1           Oligo 5
C1           Oligo 4
F1           Oligo 3
A2           Oligo 2
B2           Oligo 1

and one more condition is, this freezing should only happen wen sorting is clicked,not by default. Please reply ASAP. 

 

 

4 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 21 Aug 2015, 11:09 AM
Hello,

Sorting in RadGridView is a data operation and it is item oriented. This means that if you sort on the second column, then the entire item will be sorted based on the property column2 is bound to. For example the query to be executed would be similar to:
orderedSource = source.OrderBy(x=>x.Column2Property) 
where source is the collection assigned as RadGridView.ItemsSource.

Please note RadGridView will not update the items internally, it will just sort them.

You can also check the documentation on Custom Sorting where different options for customization are listed.

Regards,
Dimitrina
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
CHAITHRA
Top achievements
Rank 1
answered on 25 Aug 2015, 09:41 AM

Hi,

Im really sorry i couldnt figure out the exact possible solution to this.Can u please give me a code snippet of doing it??????

0
Dimitrina
Telerik team
answered on 25 Aug 2015, 12:46 PM
Hi,

Sorting in RadGridView is item based. As it turns out there is not a solution to suggest on how to modify the data in the bound items.

Regards,
Dimitrina
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
CHAITHRA
Top achievements
Rank 1
answered on 26 Aug 2015, 03:48 AM

Hi Dimitrina,

Thank you so much for the help and ur time.

Regards,

Chaithra P

Tags
General Discussions
Asked by
CHAITHRA
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
CHAITHRA
Top achievements
Rank 1
Share this question
or