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

Refresh Grid Columns After Data Change

4 Answers 3449 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brandon
Top achievements
Rank 1
Brandon asked on 19 Mar 2018, 02:48 PM

I am unsure how to do this and correctly update the columns on the grid. 

To sum up my use case the below is a very simple example of what I am trying to do. 

Grid is initialized on page load with data source 1, data source 1 has columns A, B, C, D. Grid correctly shows columns ABCD. The user now wants to view a different data set by selecting a series of drop downs on the page. Updating the data source to data source 2 with columns B, D, E, F. The grid now incorrectly shows columns ABCD.

 

Is there a way to refresh the grid in Angular 2+ after a data source change that will reset columns from the data source?

4 Answers, 1 is accepted

Sort by
0
Brandon
Top achievements
Rank 1
answered on 19 Mar 2018, 05:09 PM

https://plnkr.co/edit/GGblDfUqETpBALuNlRAL?p=preview

 

Adding a plunker to better show the example above. 

0
Accepted
Nikolay Rusev
Telerik team
answered on 20 Mar 2018, 06:11 AM
Hello,

Auto-generated column will no be refreshed automatically when changing the shape of the data items. In order to refresh them, you will need to "reset" the columns collection.

Bellow is updated example demonstrating this approach.

https://plnkr.co/edit/htk7JcHcWn4Vq8ok4T8l?p=preview

Regards,
Nikolay Rusev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
congdongdientu.
Top achievements
Rank 1
Veteran
answered on 19 Aug 2020, 09:03 AM
I have a problem after reset the grid columns, the img element will be die
0
Georgi
Telerik team
answered on 21 Aug 2020, 08:17 AM

Hello,

Thank you for reaching out to us.

From the attached screenshots, I can see that something is indeed going wrong, but unfortunately I am unable to reproduce the issue and start an investigation.

Would you be able to send us all the necessary pieces of code which are sufficient to reproduce the issue? You could send them as text and that would be fine, but a working stackblitz demo will make it easier and quicker for us to start troubleshooting.

Looking forward to hearing from you.

Regards,
Georgi
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
Brandon
Top achievements
Rank 1
Answers by
Brandon
Top achievements
Rank 1
Nikolay Rusev
Telerik team
congdongdientu.
Top achievements
Rank 1
Veteran
Georgi
Telerik team
Share this question
or