Declined
Last Updated: 11 Jun 2020 07:39 by ADMIN
Annasaheb
Created on: 04 Jun 2020 19:31
Category: Grid
Type: Feature Request
0
Adding new column to a grid dynamically

We would like to add a new column(s) dynamically to a grid, This feature is very important when grid containts lots of fields. In order to resolve slow grid rendering, we are allowing user to choose columns to show/hide and render grid accordingly. Kendo generates html code for hidden columns which causes slow rendering for large data. We are already using performance improvement suggestions from kendo like virtual scrolling, paging etc.

1 comment
ADMIN
Tsvetomir
Posted on: 11 Jun 2020 07:39

Hi Annasaheb,

It is correct that the hidden option of the grid's columns only applies "display: none;" style to the specific column. However, it is present in the DOM tree. 

If you would like to dynamically add and remove columns without them being rendered, you should make use of the setOptions() method. Within the argument for the columns, pass the new collection of columns - only the ones that you would like to visualize:

https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/methods/setoptions

 

Regards,
Tsvetomir
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.