Freezing a particular column from sorting in sortabletelerikGrid

5 posts, 0 answers
  1. CHAITHRA
    CHAITHRA avatar
    4 posts
    Member since:
    Aug 2015

    Posted 19 Aug 2015 Link to this post

    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. 

     

     

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 21 Aug 2015 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. CHAITHRA
    CHAITHRA avatar
    4 posts
    Member since:
    Aug 2015

    Posted 25 Aug 2015 Link to this post

    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??????

  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 25 Aug 2015 Link to this post

    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
  6. CHAITHRA
    CHAITHRA avatar
    4 posts
    Member since:
    Aug 2015

    Posted 25 Aug 2015 Link to this post

    Hi Dimitrina,

    Thank you so much for the help and ur time.

    Regards,

    Chaithra P

Back to Top
UI for WPF is Visual Studio 2017 Ready