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

Display a restricted set of columns in columns menu

2 Answers 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sebastian
Top achievements
Rank 1
Sebastian asked on 04 May 2015, 10:29 AM

Hello,

in my grid I activated the column menu feature (http://demos.telerik.com/kendo-ui/grid/column-menu). But I have some hidden fields which I not want to be shown in the "Columns" menu item. So, is it possible to restrict the items listed under the "Columns" menu item?

Regards

Sebastian

2 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 05 May 2015, 04:01 PM

Hello Sebastian,

Out of the box you can only exclude the column from being shown/hidden through the column menu (i.e. there wont be a checkbox defined for that column which you can check/uncheck). To do so you should use the menu option when defining your column. 

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  columns: [
    { field: "id", menu: false },
    { field: "name" },
    { field: "age" }
  ],
  columnMenu: true,
  dataSource: [
    { id: 1, name: "Jane Doe", age: 30 },
    { id: 2, name: "John Doe", age: 33 }
  ]
});
</script>


Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Sebastian
Top achievements
Rank 1
answered on 06 May 2015, 07:47 AM

Hello,

this solution worked for me. Thank you!

Regards

Sebastian

Tags
Grid
Asked by
Sebastian
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Sebastian
Top achievements
Rank 1
Share this question
or