# Stored procedure loaded DataGrid

**URL:** <https://forum.radzen.com/t/stored-procedure-loaded-datagrid/5405>\
**Category:** Angular\
**Created:** [October 26, 2020, 4:16pm UTC](https://forum.radzen.com/t/stored-procedure-loaded-datagrid/5405 "2020-10-26T16:16:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DAGamer](https://forum.radzen.com/letter_avatar_proxy/v4/letter/d/bc8723/32.png) [@DAGamer](https://forum.radzen.com/u/DAGamer)\
**Post date:** [October 26, 2020, 4:16pm UTC](https://forum.radzen.com/t/stored-procedure-loaded-datagrid/5405/1 "2020-10-26T16:16:16Z")

</div>

Probably missing something simple, have a DataGrid bound to a stored procedure, but adding/deleting new items does not refresh the data in the grid.

Have to navigate away, then back and then the data changes are shown.

Where is the best place(s) to ensure the DataGrid gets reloaded after add/edit/delete?

Thanks

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [October 27, 2020, 7:05am UTC](https://forum.radzen.com/t/stored-procedure-loaded-datagrid/5405/2 "2020-10-27T07:05:20Z")

</div>

You are not missing anything - auto-refresh in this case is not supported. You can call load() method of the DataGrid to get latest data.

---

<div class="post-metadata">

**Author:** ![DAGamer](https://forum.radzen.com/letter_avatar_proxy/v4/letter/d/bc8723/32.png) [@DAGamer](https://forum.radzen.com/u/DAGamer)\
**Post date:** [November 3, 2020, 8:16pm UTC](https://forum.radzen.com/t/stored-procedure-loaded-datagrid/5405/3 "2020-11-03T20:16:55Z")

</div>

Can you provide an example of how that works, what the code looks like?  
So In the RowSelect event, it opens the edit dialog. Do I 'Execute Code' in the 'Then' event to refresh the DataGrid?

---

<div class="post-metadata">

**Author:** ![DAGamer](https://forum.radzen.com/letter_avatar_proxy/v4/letter/d/bc8723/32.png) [@DAGamer](https://forum.radzen.com/u/DAGamer)\
**Post date:** [November 3, 2020, 8:28pm UTC](https://forum.radzen.com/t/stored-procedure-loaded-datagrid/5405/4 "2020-11-03T20:28:55Z")

</div>

Found an example here:

> [@Datagrid and custom methods refresh](http://forum.radzen.com/t/datagrid-and-custom-methods-refresh/2467):
>
> Hello, I have used a custom method to load joined data to a datagrid, and I have added the delete, edit and add methods like in regular CRUD pages. The issue that I have, is that when I edit a record, everything works fine except that I have to reload the page to see the edited values on the grid. The same happens when adding (can't see the added record in the grid until I refresh). How can I get the grid working as it was a regular crud page (as if it was using a data source method)? Thanks…

---

<div class="post-metadata">

**Author:** ![jrfragoso](https://forum.radzen.com/user_avatar/forum.radzen.com/jrfragoso/32/6366_2.png) [@jrfragoso](https://forum.radzen.com/u/jrfragoso)\
**Post date:** [November 23, 2020, 9:56pm UTC](https://forum.radzen.com/t/stored-procedure-loaded-datagrid/5405/5 "2020-11-23T21:56:33Z")

</div>

You have to execute: `setTimeout(()=> {this.grid0.load();}, 0)` in the `Then` even of the `Open Dialog` method.  
The `setTimeout()` is to avoid the error:

> Cannot read property 'load' of undefined.
