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

Recreate Grid on dropdown select

1 Answer 88 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mihai
Top achievements
Rank 1
Mihai asked on 07 Mar 2019, 06:47 PM

Hello,

We have a need to recreate the grid entirely when user selects an option from a dropdown. Both columns and data will be different.

Currently, I have tried updating the datasource being passed to the grid, but the old columns still remain.

Is it possible to get a demo on how to do this with the React grid version? This is a common use case.

Your help is appreciated,

Mihai

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 11 Mar 2019, 07:33 AM
Hello, Mihai,

This can be achieved by dynamically changing the columns array passed to the Grid when the DropDown value changes.

I made an example demonstrating this:

https://stackblitz.com/edit/react-ppcave?file=app/main.js

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Mihai
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or