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

Disable a checkbox in ColumnMenuChooser component

2 Answers 878 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kate
Top achievements
Rank 1
Kate asked on 26 Apr 2021, 03:38 PM

Hello, 
I'm using Kendo UI Grid for Angular. I'm using the ColumnMenuChooser component in two places in my code.
In one place, I'm using just the generic directive :

<kendo-grid-columnmenu-chooser [service]="service">
</kendo-grid-columnmenu-chooser>

In another place, I'm using a more customized code :

<ng-template #template>
<kendo-grid-columnlist
[columns]="columns"
[applyText]="localization.get('columnsApply')"
[resetText]="localization.get('columnsReset')"
[autoSync]="autoSync"
[allowHideAll]="allowHideAll"
(apply)="onApply($event)"
(columnChange)="onChange($event)"
>
</kendo-grid-columnlist>
</ng-template>

In both places, is it possible to disable a column's checkbox according to its column's property ?
I know this was possible in Kendo UI grid for jQuery but I can't find a way to do it in Kendo UI for Angular.
The goal is that if a given column has a certain property true (for example "locked = true", then it would be impossible for the end user to hide it via the ColumnMenuChooser component.
Thank you in advance

2 Answers, 1 is accepted

Sort by
0
Kate
Top achievements
Rank 1
answered on 27 Apr 2021, 09:43 AM

If there are no other choice, I'm thinking about using the 'includeInChooser' input, which will remove completely the column from the chooser.

Is there a way to just disable the checkbox instead of removing the column ?

0
Accepted
Svet
Telerik team
answered on 29 Apr 2021, 08:04 AM

Hi Kate,

It looks like the kendo-grid-columnlist component is custom. I am not sure what its content is, but it looks like it is used in such way that a generic input of type checkbox is rendered for each of the columns array items passed to it.  If that is the case, then this approach will allow you to control the state of the input through its generic [disabled] input property.

About the ColumnMenuChooser component, it doesn't currently provide the required functionality as a built in feature. 

The includeInChooser option could definitely be used to control which columns are added to the ColumnMenuChooser.

Regards,
Svetlin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
Kate
Top achievements
Rank 1
Answers by
Kate
Top achievements
Rank 1
Svet
Telerik team
Share this question
or