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

best practice when need to change grid options/datasource

1 Answer 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
nir
Top achievements
Rank 1
nir asked on 08 Jul 2014, 12:59 PM
In an application I'm developing, i need to use the same space to display information from different sources with different formats in a grid according to what item was selected on a TreeView.

i found two ways to achieve this: 
1. find the grid then destroy and recreate it.
2. find the grid then change datasoruce/options/

I'm very new to Kendo, so i'm not sure which approach would be wiser. 

any advice?

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 09 Jul 2014, 12:35 PM
Hello Nir,

Generally speaking both approaches are valid. If you do not need to change the modify the grid column settings but just to change the displayed data it is better to modify the dataSource (filter or set a new one).
In case you would like to completely change the Grid settings you have to destroy the widget and re-create it.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
nir
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or