# DataGrid row selection event

**URL:** <https://forum.radzen.com/t/datagrid-row-selection-event/11955>\
**Category:** Radzen.Blazor Components\
**Created:** [October 10, 2022, 10:23am UTC](https://forum.radzen.com/t/datagrid-row-selection-event/11955 "2022-10-10T10:23:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hatvanis](https://forum.radzen.com/letter_avatar_proxy/v4/letter/h/cc9497/32.png) [@hatvanis](https://forum.radzen.com/u/hatvanis)\
**Post date:** [October 10, 2022, 10:23am UTC](https://forum.radzen.com/t/datagrid-row-selection-event/11955/1 "2022-10-10T10:23:32Z")

</div>

Hi,  
I use RowClick event listener on RadzenDataGrid but when I want to know which row was selected it returns null in the bindied value or in the argumentum of event listener.

`SelectionMode="DataGridSelectionMode.Single" @bind-Value=@SelectedRows RowClick="@((args) => OnRowClick(args))"`

`protected void OnRowClick(MouseEventArgs args)`

Is there any way to gain the selected object or its id in a DataGrid component, please?

---

<div class="post-metadata">

**Author:** ![hatvanis](https://forum.radzen.com/letter_avatar_proxy/v4/letter/h/cc9497/32.png) [@hatvanis](https://forum.radzen.com/u/hatvanis)\
**Post date:** [October 10, 2022, 10:27am UTC](https://forum.radzen.com/t/datagrid-row-selection-event/11955/2 "2022-10-10T10:27:21Z")

</div>

I'm sorry I've noticed just now there is a RowSelect event.

---

<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:** [October 10, 2022, 11:04am UTC](https://forum.radzen.com/t/datagrid-row-selection-event/11955/3 "2022-10-10T11:04:00Z")

</div>

The event arguments of the RowClick event are [different](https://blazor.radzen.com/docs/api/Radzen.DataGridRowMouseEventArgs-1.html).

```auto
protected void OnRowClick(DataGridRowMouseEventArgs<MyItem> args)
{
   MyItem item = args.Data;
}

```

---

<div class="post-metadata">

**Author:** ![Thomas\_Adrian](https://forum.radzen.com/user_avatar/forum.radzen.com/thomas_adrian/32/18226_2.png) [@Thomas\_Adrian](https://forum.radzen.com/u/Thomas_Adrian)\
**Post date:** [June 26, 2024, 7:23pm UTC](https://forum.radzen.com/t/datagrid-row-selection-event/11955/4 "2024-06-26T19:23:20Z")

</div>

> [@hatvanis](#):
>
> RowSelect

In case anyone are still struggeling to trigger an event when a row is selected

Make sure both RowSelect and TItem is set.

````auto
TItem="Inovice"
RowSelect="@OnRowSelect"

private void OnRowSelect(Invoice item){
}```
````
