Datagrid is not refreshing when updating data

1 Answer 933 Views
Grid
Daniela
Top achievements
Rank 1
Iron
Iron
Iron
Daniela asked on 28 Sep 2021, 09:19 AM

Hello,

 

I´m using this example exactly the same code except that I am loading the data from a service https://www.telerik.com/kendo-react-ui/components/grid/

The problem is that once the data is loaded it is not displayed in the table, I have to click order by some column to display the data, the same happens when I modify a row and refresh the data it is not coming unless I press the order by some column, I hope I am being clear otherwise please let me know.

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 28 Sep 2021, 10:28 AM

Hello, Daniela,

The Grid will be updated if its data is bound to the state and the state updates.

In that example, the Grid is bound to dataResult variable, which has to be updated when the new data is received. It could be something like this:

setNewData = (newData) => {
    setDataResult(process(newData,dataState));
}
If the issue still occurs, please share an example and I will be happy to inspect it.

Regards,
Stefan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Daniela
Top achievements
Rank 1
Iron
Iron
Iron
commented on 28 Sep 2021, 12:01 PM

that worked well, thanks a lot!
Tags
Grid
Asked by
Daniela
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Stefan
Telerik team
Share this question
or