Harry
October 4, 2021, 11:06am
1
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
Harry
October 4, 2021, 2:01pm
3
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.
gfkucas
December 27, 2022, 9:37pm
4
This is not working for me. "Cannot convert lambda expression to type 'object' because it is not a delegate type". Any ideas?
korchev
December 28, 2022, 1:25am
5
RadzenDataGrid now supports cell selection. Check this demo: Blazor DataGrid cell selection
2 Likes