On a TelerikGrid, I allow users to filter, resize, reorder, hide and lock coumns. I also have a button that lets them reset the grid state to the default settings.
This all works great except that the locked property of a grid column cannot be cleared under any circumstances that I can find. When I set state to null using SetStateAsync(null), all the user customizations are reset back to defaults and the grid is re-bouund, but the user-locked columns stay locked. Even if I trigger another manual rebind it does not update the locked status. I have to do a full page refresh to get back to the normal state.
I have a demonstration of this behavior here:
https://blazorrepl.telerik.com/mUYyvRPU52qGBUkY21
To reproduce:
- using the above Repl, change a couple of columns settings like width, order, sort or filter
- using the drop down menu on the first column, set the state to locked
- click on the Reset State button
- notice that all settings are reset to original, except for the locked column
One thing I have done with some success is instead of setting GridState to null, I create a new empty grid state , create a ColumnState for every column and set the Locked property to false. That will unlock the column. However, the default state of some of our colums is locked=true and I don't have a way of programmatically determining which columns should be locked by default, so this method unlocks all columns, which is not what I want.
Is there a reason that the locked status is not reset with the other settings and is there any way to force them to reset? Alternatively, is there any way to get the default column status out of the grid at runtime?
