I have an igx grid inside a dialog. I use the array posts as data for the grid. The values of this array may be changed through the program. How can I update the grid data with the last value that I have for the array posts?
<igx-dialog #dialog>
<igx-grid #grid1
[emptyGridMessage]="'The grid is empty'"
width="1200px"
[data]="posts"
height="600px"
style="margin: auto"
[primaryKey]="'person'">
<igx-column field="person" dataType="string" header="PersonId"></igx-column>
<igx-column field="name" dataType="string" header="Name"></igx-column>
</igx-grid>
</igx-dialog>
P.S. I am using C#.
When the data changes on your component side, you can call
markForCheck()on the grid and this will force the grid to run change detection and display the updated data.Example
component.ts: