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

How to create a grid programmatically?

3 Answers 71 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David OBrien
Top achievements
Rank 1
David OBrien asked on 17 Aug 2012, 02:46 PM
Say I have 4 comboboxes
Once a user selects something from all 4 I want to create a grid using a datasource based off the choices they selected...

Example video included :)

in the change event on the last combobox I am making an alert box pop up witht he values chosen in it

Can I just create the grid in that change function?

3 Answers, 1 is accepted

Sort by
0
David OBrien
Top achievements
Rank 1
answered on 17 Aug 2012, 03:14 PM
Well I tried it and yes it works, nevermind :)
0
David OBrien
Top achievements
Rank 1
answered on 17 Aug 2012, 04:15 PM
Okay since I can create grids based of the user selections how can I destroy a grid so each time they change the selections I don't end up with 40 grids on the page?

I don't see a destroy method in the grid api

There is a reference to remove in the events section but how do you remove the grid?
0
Petur Subev
Telerik team
answered on 20 Aug 2012, 11:49 AM
Hello David,

A method called destroy should be available for each of the widgets in the latest internal build. When you call it all the events and the memory used for the widgets will be cleared. After executing the method above you can use the jQuery remove method to remove the html elements of the Grid too.
e.g.
$('#Grid').data('kendoGrid').destroy();
$('#Grid').remove();


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