How can I lock one column as the first column of the grid, so it can not be moved/rearranged or hidden?
I tried Frozen columns, but I was able to reorder and hide the "locked" columns.
http://demos.telerik.com/kendo-ui/grid/frozen-columns
Thanks
5 Answers, 1 is accepted
You can prevent the dragging for particular columns with the approach demonstrated in the following dojo example:
As for the other requirement, you could try to set the column to be visible with the showColumn method of the Grid within the columnHide event:
Best Regards,
Konstantin Dikov
Progress Telerik
Hello Konstantin,
Thanks for your answer, it was helpful, but I have a slight issue.
My issue is that I want to lock a column as first column in grid.
While I was able to prevent a certain column from dragging, I am still able to drag other columns infront of my "locked" column, thus making the column not first nor locked.
Is there a possiblity to get the index of position the column is being dragged, so I could disable all the columns from being dragged to 0 index position?
Or you would suggest something else?
The main problem here is that the reordering could not be canceled and the only thing that I could suggest is the following approach, but it will have a glitch:
As for a better solution, you could create a feature request in our public portal for introducing an option for preventing the reordering:
Regards,
Konstantin Dikov
Progress Telerik
Would it be possible to remove the element from the dropdown list all in all, where user is trying to hide the column?
Here is a dojo example with the requested functionality, where we manually remove a column from the column menu within the columnMenuInit event:
Best Regards,
Konstantin Dikov
Progress Telerik