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

Column header disappears when trying to refresh grid with a new data

3 Answers 532 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 15 May 2012, 04:07 PM
Hello,

I am trying to refresh a grid with a new data source that has different columns, but when I do so, the column headers disappear.

You can see what I mean here: http://jsfiddle.net/YZcYC/3/ 

One thing I noticed was that if I do

grid.columns = [];

the header shows up, but I need to be able to specify column titles, templates, widths, etc, so that's not an option for me.

Any ideas?

Thanks,
Bob

3 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 16 May 2012, 02:16 PM
Hello Bob,

I am afraid that this scenario is not supported - you cannot change the columns array after the grids initialization.
The rowTemplate on the other hand could be modified via grid's options:
grid.options.rowTemplate = encTemplate2;


Greetings,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Bob
Top achievements
Rank 1
answered on 16 May 2012, 03:18 PM
Thanks Alexander.  I was able to get it working by calling grid._thead() before updating the data source.  I'm glad you guys expose the "private" methods so people can still call them at their own discretion.

Thanks again.
0
Naresh
Top achievements
Rank 1
answered on 05 Aug 2013, 01:35 AM
Hi Bob
Can you please provide your solution to this issue as I have same requirement.

Thanks,
Tags
Grid
Asked by
Bob
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Bob
Top achievements
Rank 1
Naresh
Top achievements
Rank 1
Share this question
or