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

Angular2-How To hide column from ColumnMenu/kendo-grid-column-chooser.

1 Answer 1933 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Neel
Top achievements
Rank 1
Neel asked on 20 Jul 2018, 06:49 AM
Hello,

I am getting extra data from web API than what I display in UI. I am binding this data to kendo-grid and setting it as hidden. Because I am using it for another task. 
And, I don't want to show this column in (Where I can show/hide column). 

Accept this, all column will be visible and if I uncheck/check any column from UI than it should be available to check/uncheck again. 
But not that few columns should be visible which I want to hide forever in  

I saw the below-given link but, don't get much idea about resolving. 

https://www.telerik.com/kendo-angular-ui/components/grid/columns/menu/#toc-customizing-the-content

Nitin
Top achievements
Rank 1
commented on 18 Aug 2023, 05:21 AM

Hi 
In my case, my grid has 4 columns and I want to show 3 columns in the column chooser
how to achieve this scenario?

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 23 Jul 2018, 08:48 AM
Hello Neel,

When the extra Grid columns are hidden via the respective Grid column property, they will be still be available in the Column Menu column chooser, but if they are hidden via the Angular *ngIf structural directive, they will not be rendered at all and will be unavailable in the Column menu, e.g.:

https://plnkr.co/edit/vkiyeOaxbDHme1tFkDVw?p=preview

The most straight-forward approach to not display columns for certain data item properties in the Grid, is to simply omit them from the column definitions in the Grid markup (you will still have access to them for displaying purposes in the Cell templates of other Grid columns, e.g.):

https://plnkr.co/edit/SBQro9w3f97lP0d0ojV8?p=preview

I hope this helps.

Regards,
Dimiter Topalov
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
General Discussions
Asked by
Neel
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or