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

Disable or remove sortable capability on column with rebuilding entire grid.

1 Answer 1206 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Grant
Top achievements
Rank 1
Grant asked on 05 Jun 2012, 06:41 AM
Hi there,

Is it possible to disable columns (Or at least remove their sort functionality so when they are clicked) without having to redraw the entire grid?

I have a grid with sorting initially enabled, then when a button is clicked I want to move into a "design mode" and therefore need to remove the sortable functionality (or at least stop the event firing when a column is clicked which causes a read of the datasource). 

Is there any way to do this? I managed to disable filtering by hiding the filter icon but can't seem to disable sorting in any way...

Thanks in advance!

Rob

1 Answer, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 07 Jun 2012, 10:26 AM
Hello Grant,

This is not supported out of the box, but to achieve it I can suggest the following approaches:
  • hook up to the click event of ".k-grid-header .k-link" and stop the propagation
    $(".k-grid-header .k-link").click(function(e) {
        e.stopPropagation();
    });
  • prevent the click by covering the ".k-grid-header " with a transparent <div> element. In this forum thread you will find an example and more information about this solution.

I hope this helps.

Greetings,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Grant
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or