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

Removing the reorderability of the particular template column in telerik MVC Grid.

4 Answers 70 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nikhil Kashyap
Top achievements
Rank 1
Nikhil Kashyap asked on 21 Feb 2011, 10:57 AM
First column of my grid is a template column(i.e Check box Column).I have configured the grid to be reorderable so that user can change the column order as per the need.But I don't want the Checkbox column to be reorderable.Please suggest some solution for the above problem.

Since the reorderability is at the grid level.I need to fix this column issue.



Thanks
Nikhil
Dell inc.

4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 21 Feb 2011, 02:07 PM
Hi Nikhil Kashyap,

 This is currently not supported. Column reordering is enabled globally and there is no way to disable it for a particular column.

Regards,
Atanas Korchev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Tx3
Top achievements
Rank 1
answered on 24 Apr 2012, 08:07 AM
I am facing the same problem. My grid has a custom checkbox solution on the first column and it should stay there. Is it still the case that I can't prevent reordering for certain column?

I have tried this with no luck

grid.onColumnReorder = function (e) {
    var column = e.column;
    var oldIndex = e.oldIndex;
    var newIndex = e.newIndex;
 
    if(oldIndex === 0) {
        e.preventDefault();
        return false;
    }
};

-Tatu
0
Denisse Zavala
Top achievements
Rank 1
answered on 24 May 2012, 12:06 PM
It's not and ideal fix, but I found a way to do it:

Remove the 't-header' class of the column header you want to prevent from being reordered, add this to the grid onLoad handler
$('#no-reorderable-col-header').removeClass('t-header');

Then manually set #no-reorderable-col-header css to match the style defined for .t-header.
0
Tx3
Top achievements
Rank 1
answered on 24 May 2012, 12:11 PM
Cool, I'll try that one. Thanks!

-Tatu
Tags
General Discussions
Asked by
Nikhil Kashyap
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Tx3
Top achievements
Rank 1
Denisse Zavala
Top achievements
Rank 1
Share this question
or