# RadzenGrid page changed/row filtered event handlers

**URL:** <https://forum.radzen.com/t/radzengrid-page-changed-row-filtered-event-handlers/5642>\
**Category:** Radzen.Blazor Components\
**Created:** [November 16, 2020, 10:15am UTC](https://forum.radzen.com/t/radzengrid-page-changed-row-filtered-event-handlers/5642 "2020-11-16T10:15:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ade](https://forum.radzen.com/letter_avatar_proxy/v4/letter/a/ecc23a/32.png) [@ade](https://forum.radzen.com/u/ade)\
**Post date:** [November 16, 2020, 10:15am UTC](https://forum.radzen.com/t/radzengrid-page-changed-row-filtered-event-handlers/5642/1 "2020-11-16T10:15:38Z")

</div>

Hello,  
Is it possible to add event handlers for the following events?

- Page changed
- Rows filtered

If yes, could you please address me to the documentation?

Thanks

---

<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:** [November 16, 2020, 10:19am UTC](https://forum.radzen.com/t/radzengrid-page-changed-row-filtered-event-handlers/5642/2 "2020-11-16T10:19:05Z")

</div>

Hi @ade,

The requested events are not supported.

---

<div class="post-metadata">

**Author:** ![ade](https://forum.radzen.com/letter_avatar_proxy/v4/letter/a/ecc23a/32.png) [@ade](https://forum.radzen.com/u/ade)\
**Post date:** [November 16, 2020, 10:24am UTC](https://forum.radzen.com/t/radzengrid-page-changed-row-filtered-event-handlers/5642/3 "2020-11-16T10:24:03Z")

</div>

Hi @korchev,  
thanks for the quick answer. Is there any workaround? My problem is the following:

- the grid has paging enabled
- the user can select rows. By selecting a row, some other fields of the page gets populated
- if the user changes the table page, the selection still stays on the previously selected row and the dynamic controls show data for the previously selected row, which is no longer visible. This is kind of misleading for the user.

What I would like to achieve is the reset of the current selection whenever the user changes the page or filters out rows.

Any suggestion?

---

<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:** [November 16, 2020, 10:48am UTC](https://forum.radzen.com/t/radzengrid-page-changed-row-filtered-event-handlers/5642/4 "2020-11-16T10:48:19Z")

</div>

The only thing I can suggest is to use the [LoadData](https://blazor.radzen.com/datagrid-loaddata) event of the DataGrid.

---

<div class="post-metadata">

**Author:** ![ade](https://forum.radzen.com/letter_avatar_proxy/v4/letter/a/ecc23a/32.png) [@ade](https://forum.radzen.com/u/ade)\
**Post date:** [November 16, 2020, 11:41am UTC](https://forum.radzen.com/t/radzengrid-page-changed-row-filtered-event-handlers/5642/5 "2020-11-16T11:41:41Z")

</div>

OK, thanks for your help.

---

<div class="post-metadata">

**Author:** ![\_Trevor](https://forum.radzen.com/user_avatar/forum.radzen.com/_trevor/32/5690_2.png) [@\_Trevor](https://forum.radzen.com/u/_Trevor)\
**Post date:** [January 17, 2021, 9:16pm UTC](https://forum.radzen.com/t/radzengrid-page-changed-row-filtered-event-handlers/5642/6 "2021-01-17T21:16:43Z")

</div>

@ade ,

I'm not sure if you ever found a workaround. I was having the same issue where I was trying to dynamically gather some data only for the objects the user was looking at (displayed in the grid). It would work correctly the first load, but like you when a user changed pages there was no function firing off.

I did not have luck with LoadData but I did have luck with Render.

Here is the setup:  
On your RadzenGrid add Render="Render"

In the code section:  
Create an int currentPage

Create a function  
private void Render(GridRenderEventArgs obj)  
{  
if (obj.Grid.CurrentPage != currentPage)  
{  
currentPage = obj.Grid.CurrentPage;  
//Reset your selected data  
}  
}

I had to keep track of the current page as the Render function gets called when the state changes. This potentially prevents a loop.  
I hope this helps you or anyone else that comes across this.

-Trevor
