Lock a column from move or hide


I have a grid that has moving and hiding columns enabled. I also need to lock the 1st column so it cannot be moved or hidden. Is there a way of setting this or overriding using an onBeforeCMove event?


Yep, this event can be used to block unwanted move operations.

[code]mygrid.attachEvent(“onBeforeCMove”,function(oind, nind){
if (oind == 0 || nind == 0) return false;
return true;
//second parameter need to be updated , according to your grid settings
mygrid.enableColumnMove(true, “false,true,true,true,true…”);


Blocking of hiding is a bit more problematic. Next code can be used ( it doesn’t really block operation, but have similar result )

    if (state == true && ind == 0)
           grid.setColumnHidden(ind, false); //show first column