Using await in SelectColumns OnSelect #3287
tokg-semler
started this conversation in
General
Replies: 1 comment 18 replies
-
@vnbaaij @dvoituron I wonder if this might be considered a bug? The I see this a lot in internal async Task HandleOnRowClickAsync(string rowId)
{
var row = GetRow(rowId);
if (row is not null && !string.IsNullOrWhiteSpace(row.Class) && (row.Class.Contains(FluentDataGrid<TGridItem>.EMPTY_CONTENT_ROW_CLASS) || row.Class.Contains(FluentDataGrid<TGridItem>.LOADING_CONTENT_ROW_CLASS)))
{
return;
}
if (row != null && Grid.OnRowClick.HasDelegate)
{
await Grid.OnRowClick.InvokeAsync(row);
}
if (row != null && row.RowType == DataGridRowType.Default)
{
// foreach (var column in Grid._columns)
foreach (var column in Grid._columns.ToList())
{
await column.OnRowClickAsync(row);
}
}
} |
Beta Was this translation helpful? Give feedback.
18 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I hope you can help me out and point me in the right direction.
I want to use DataGrid checkboxes and catch the event when something is selected. After that, I want to use that information to check if other options should be disabled.
But every time I perform some async work in the OnSelect event, I get an error:
Unhandled exception rendering component: Collection was modified; enumeration operation may not execute.
in /_/src/Core/Components/DataGrid/FluentDataGridRow.razor.cs:line 121
Any help is very much appreciated.
Sample code:
Beta Was this translation helpful? Give feedback.
All reactions