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

Lock Column Issue

9 Answers 1266 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Keith Pepling
Top achievements
Rank 1
Keith Pepling asked on 30 Jul 2014, 07:16 PM
Is there a way to load a grid without any locked columns initially and then lock a column?  If I load a grid with no locked columns then I don't even get the option in the column menu to lock.  I also noticed that if I load a grid with one column locked that I can not unlock that column either without first locking another column.  Is this behavior intended and if so is this going to change in the future?

9 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 31 Jul 2014, 07:35 AM
Hello Keith,

In order to have the locking feature enabled for the grid, you will need to have at least one column locked when initialized.  This is needed so the correct scrollers and heights are set in the grid and it is prepared in order for the locked feature two work. Same is valid for having at least one column locked all the time, when this feature is enabled.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Simon
Top achievements
Rank 1
answered on 25 Feb 2015, 08:54 PM
Hello Kiril,

It may sound a little bit basic but can't those scrollers be set and calculated on an hidden div?  

My users are also requesting for this feature for a while and they don't understand why there's such a limitation.  I'm really struggling to provide them a good explanation (they would understand) as this feature is available with most grid widgets they've used in the past.

The best I could do so far is to create a fake frozen column with a width of 0.  The problem with this solution is that even if you manage to keep that column hidden in the UI, the column still exists... For instance, it will be listed with every other columns and we have to manage the code all over the place to ignore that column (ex: sort / filter / etc.).

Do you have any plan about improving the frozen column behavior?

Best regards,

Simon
-1
Kiril Nikolov
Telerik team
answered on 27 Feb 2015, 09:14 AM

Hello Simon,

I am afraid that there is no immediate plan for this change, however you can submit this as a feature request on UserVoice, so it will be considered for a future release.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bridge24
Top achievements
Rank 1
Iron
answered on 11 Jun 2015, 08:12 PM

Wow, I am really surprised that I MUST lock any of my columns to allow my users to edit locked columns...

It's exactly like if I I need to "group" 1 column to enable grouping, or if I must have 1  column "sorted" to enable sorting... 

Why can't we enable "allowlock: true" globally in the grid, to get the "lock-unlock" item in the menu, even if no "locked column" is there initially?

0
Kiril Nikolov
Telerik team
answered on 12 Jun 2015, 12:04 PM

Hello Dani,

It is required, just because the Kendo UI Grid with frozen columns feature needs to do the correct resizing and aligning the columns, if you inspect the elements you will see that there are actually two tables rendered for the frozen columns functionality that align and resize each other. With that said - option like "allowblock:true" is currently not supported.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bridge24
Top achievements
Rank 1
Iron
answered on 12 Jun 2015, 01:12 PM

Thank you.

I tried a little hack, locking a column on initial load (to get the item in the menu), then, unlock it immediatly after with grid.unlockColumn("fieldname") but I get the error "There should be at least one non locked column"... 

But, your documentation is clear, there "must" be one locked column, we can't unlock the last one...

Do you have any workaround to allow a user to be able to lock a column, but also allowing him to lock "nothing"?

Thank you

-1
Kiril Nikolov
Telerik team
answered on 16 Jun 2015, 01:27 PM

Hello Dani,

I am afraid that we do not have a workaround that will allow the user to lock nothing, as I said - there should be at least one locked column.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
commented on 14 Dec 2022, 08:33 PM

This is unacceptable. A user should be able to have any number of locked columns, including zero. 
Nikolay
Telerik team
commented on 16 Dec 2022, 01:52 PM

Hi Lee,

If you consider this feature an important one I recommend submitting a request in the Feedback portal:

I can suggest implementing a custom button where on clicking with the help of the setOptions() method you can set the Grid first column, for instance, to be locked.

Regards,

Nikolay

 

 

0
Priyank
Top achievements
Rank 1
Veteran
answered on 07 Jan 2021, 09:33 AM

Hello Guys,

I have some issue with lock column.The issue is when lock applied on column after that when i reorder unlock column with lock column the unlock column also became lock column.

I want to disable reordering with lock column and i also fix this prevent reordering with lock column. By using this small example

But still facing issue when just beside unlock column reorder with lock column then i facing this issue. The unlock column also became lock column.
Is there Any way to fix this ?

Thanks. 

0
Petar
Telerik team
answered on 11 Jan 2021, 08:41 AM

Hi Priyank,

Can you share which version of Kendo UI for jQuery do you use? The Dojo example that you send me uses the Kendo UI for jQuery version from 2015 which doesn't have the functionality provided by our latest product releases. 

If you check this Dojo example, you will see that columns have a "lockable" property definition set to "false". With this property, the Grid will prevent the "locked" column to be unlocked and the "unlocked" columns from being locked. With this configuration, the columns inside the Grid will continue to be reorderable, which, if I understand your description correctly, is what you need to implement in your application. 

You can test the linked Dojo. If it demonstrates what you need in your application, I would recommend upgrading your project to the latest Kendo UI for jQuery version. 

I hope the above will help you implemented the desired functionality.

Regards,
Petar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Keith Pepling
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Simon
Top achievements
Rank 1
Bridge24
Top achievements
Rank 1
Iron
Priyank
Top achievements
Rank 1
Veteran
Petar
Telerik team
Share this question
or