[DataGrid] OnRowClick and SelectColumn together not as expected.
🐛 Bug Report
If using a SelectColumn and OnRowClick when clicking the check box the row click event also fires. Can this not happen? Or can there be an option to turn it off?
🤔 Expected Behavior
When clicking the SelectColumn the RowClick handler shouldn't fire.
😯 Current Behavior
When clicking the SelectColumn the RowClick handler does fire.
🔦 Context
Using the grid and using on row click to navigate to the record, but have the option to select multiple records to then delete them or run another process.
🌍 Your Environment
.NET 8 Fluent UI Blazor library Version 4.8.1
Duplicate. See #2252
I'm not sure this is a duplicate of that ticket as that is allowing a selection of a row from a row click and there is no OnRowClick event being used?
It allows you to restrict selection to clicking on the checkbox/radio button. Is that not what you are after?
Let me 5min to verify if the OnRowClick is raised with this new feature
Yes, using the new SelectFromEntireRow="false" attribute, the OnRowClick event is still triggered.
But you will have a new OnCellClick event to detect which cell is clicked e.GridColumn.
I think you could use this new event to detect which column to exclude.
<FluentDataGrid Items="@People" ShowHover="@SelectFromEntireRow" TGridItem="Person"
OnRowClick="@(e => Console.WriteLine($"Row {e.RowIndex} clicked"))"
OnCellClick="@(e => Console.WriteLine($"Cell on column {e.GridColumn} clicked"))">
Cell on column 2 clicked
Row 4 clicked
Cell on column 1 clicked
Row 4 clicked
I'm after it so that we can have row click which does an action but when selecting a checkbox in the row it doesn't trigger the on row click as that can conflict. Also there could be buttons/inputs in the row so those would need to not propagate up to the row click event also.
@dvoituron thanks, OnCellClick sounds like it may do the job!