# Problem with DataGrid's Reload()

**URL:** <https://forum.radzen.com/t/problem-with-datagrids-reload/11214>\
**Category:** Radzen.Blazor Components\
**Created:** [July 4, 2022, 8:15pm UTC](https://forum.radzen.com/t/problem-with-datagrids-reload/11214 "2022-07-04T20:15:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwu](https://forum.radzen.com/letter_avatar_proxy/v4/letter/j/bcef8e/32.png) [@jwu](https://forum.radzen.com/u/jwu)\
**Post date:** [July 4, 2022, 8:15pm UTC](https://forum.radzen.com/t/problem-with-datagrids-reload/11214/1 "2022-07-04T20:15:11Z")

</div>

Upon initializing DataGrid displays all the test data as shown below:

 ![image](https://forum.radzen.com/uploads/default/original/2X/9/9fe6631b06299e82332cdb2e2a5901f4fd4f03ed.png)

The DataGrid is defined as below:

```auto
<RadzenDataGrid
  @ref ="@_grid"
  AllowFiltering ="true"
  AllowRowSelectOnRowClick="true"
  FilterMode ="FilterMode.Advanced"
  Data ="@Presenter?.Parts"
  RowDeselect ="OnRowDeselect"
  RowSelect ="OnRowSelect"
  SelectionMode ="DataGridSelectionMode.Multiple"
  TItem ="Part">

```

Presenter.Parts is simply a List. Again, after the initialization, the grid is displaying fine.

Then I proceed to delete one of the rows by removing an element from Presenter.Part.

`Parts?.RemoveAll(p => parts.Contains(p));`

After that, I invoke the Reload() and StateHasChanged().

```auto
_grid?.Reload();
InvokeAsync(StateHasChanged);

```

This is when the grid gets "out-of-sync".

The Parts property has count of 3.

 ![image](https://forum.radzen.com/uploads/default/original/2X/c/c53bf6155c5bb6cc7f73e16b50733649c4e41686.png)

But somehow, \_view of the DataGrid only has 2.  
 ![image](https://forum.radzen.com/uploads/default/original/2X/5/5848fe98c8380d9cad1d62f5cda299f59d916046.png)

What am I missing? As always, thank you!

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [July 4, 2022, 8:56pm UTC](https://forum.radzen.com/t/problem-with-datagrids-reload/11214/2 "2022-07-04T20:56:11Z")

</div>

You need to change the reference otherwise the DataGrid will not know that Presenter.Parts has changed. Something like

`Presenter.Parts = Presenter.Parts.ToList();`

---

<div class="post-metadata">

**Author:** ![jwu](https://forum.radzen.com/letter_avatar_proxy/v4/letter/j/bcef8e/32.png) [@jwu](https://forum.radzen.com/u/jwu)\
**Post date:** [July 4, 2022, 9:13pm UTC](https://forum.radzen.com/t/problem-with-datagrids-reload/11214/3 "2022-07-04T21:13:33Z")

</div>

For the folks who might be looking at this,

I used:

`_grid.Data = Presenter?.Parts?.ToList();`

This is done before the Reload().

---

<div class="post-metadata">

**Author:** ![Robot](https://forum.radzen.com/letter_avatar_proxy/v4/letter/r/7993a0/32.png) [@Robot](https://forum.radzen.com/u/Robot)\
**Post date:** [September 29, 2024, 11:31am UTC](https://forum.radzen.com/t/problem-with-datagrids-reload/11214/4 "2024-09-29T11:31:00Z")

</div>

@jwu How to keep the row expanded after delete or add?
