Skip to content

Commit

Permalink
[DataGrid] Invoke OnRowClick from HandleOnRowKeyDownAsync (microsoft#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vnbaaij authored and dannyldj committed Sep 26, 2024
1 parent 90c6bb5 commit 1372579
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3345,7 +3345,7 @@
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.DialogParameters.Visible">
<summary>
Gets or sets if a dialog is visible or nt (Hidden)
Gets or sets if a dialog is visible or not (Hidden)
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.DialogParameters.PreventScroll">
Expand Down Expand Up @@ -3406,7 +3406,7 @@
<summary>
Gets or sets the height of the dialog. Must be a valid CSS height value like "600px" or "3em"
Only used if Alignment is set to "HorizontalAlignment.Center"
</summary>
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.DialogParameters.DialogBodyStyle">
<summary>
Expand Down Expand Up @@ -3440,7 +3440,7 @@
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.DialogParameters.ShowSecondaryAction">
<summary>
Gets whether the secondary button is displayed or not. Depends on SecondaryAction having a value.
Gets whether the secondary button is displayed or not. Depends on SecondaryAction having a value.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.DialogParameters.OnDialogResult">
Expand Down
10 changes: 8 additions & 2 deletions src/Core/Components/DataGrid/FluentDataGridRow.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,14 @@ internal async Task HandleOnRowKeyDownAsync(string rowId, KeyboardEventArgs e)
return;
}

var row = GetRow(rowId, r => r.RowType == DataGridRowType.Default);
if (row != null)
var row = GetRow(rowId);

if (row != null && Owner.Grid.OnRowClick.HasDelegate)
{
await Owner.Grid.OnRowClick.InvokeAsync(row);
}

if (row != null && row.RowType == DataGridRowType.Default)
{
foreach (var column in Owner.Grid._columns)
{
Expand Down

0 comments on commit 1372579

Please sign in to comment.