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

Locking column to left of grid

5 Answers 359 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jaanus
Top achievements
Rank 1
Jaanus asked on 22 Sep 2017, 01:08 PM

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

Sort by
0
Konstantin Dikov
Telerik team
answered on 26 Sep 2017, 12:51 PM
Hello Jaanus,

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
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Jaanus
Top achievements
Rank 1
answered on 26 Oct 2017, 01:14 PM

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?

0
Konstantin Dikov
Telerik team
answered on 30 Oct 2017, 11:07 AM
Hi Jaanus,

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
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Jaanus
Top achievements
Rank 1
answered on 06 Dec 2017, 04:19 PM

Would it be possible to remove the element from the dropdown list all in all, where user is trying to hide the column?

0
Konstantin Dikov
Telerik team
answered on 08 Dec 2017, 01:57 PM
Hi Jaanus,

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
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Jaanus
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Jaanus
Top achievements
Rank 1
Share this question
or