Grid cell click

Is there a way to see what cell you clicked on within the Radzen Datagrid?

I only see RowClick and RowDoubleClick with no property in them for which cell as far as I can tell.

I want to have different actions for different cells on my grid rather than different rows.

Thanks.

1 Like

Hi @Harry,

Currently there isn't a built-in CellClick event. A possible workaround is to use a template:

<RadzenDataGridColumn Property="Name" TItem="Customer">
   <Template Context="customer">
      <div @onclick=@(() => OnColumnClicked(customer, "Name"))>
         @customer.Name
      </div>
   </Template>
</RadzenDataGridColumn>

@code {
   void OnColumnClicked(Customer customer, string column)
   {
   }
}
1 Like

Thank you. It'd be great if there was a cellclick event, I hope that's something you're considering, but for my needs atm that workaround is sufficient. Thank you.

This is not working for me. "Cannot convert lambda expression to type 'object' because it is not a delegate type". Any ideas?

RadzenDataGrid now supports cell selection. Check this demo: Blazor DataGrid cell selection

1 Like