Async call not await - potential cause of issue in DataGrid #839

Closed
opened 2026-01-29 17:45:08 +00:00 by claunia · 2 comments
Owner

Originally created by @CoderJason123 on GitHub (May 4, 2023).

Scenario: when Settings is bound, plus Filter is bound, the filter value gets overwritten. The async call to OnFilter at ApplyFilter(RadzenDataGridColumn<TItem> column, bool closePopup = false), in RadzenDataGrid.razor.cs is not awaited.

OnFilter(new ChangeEventArgs() { Value = column.GetFilterValue() }, column, true);

What happens is that a filter is applied then immediately removed by a second call. Overall I'm just trying to save and restore settings per the guidance, as well as trap what a person is filtering, so i can go to the db and filter it there first. The combination of Filter and bound settings is how to recreate it.

When i remove the Filter event callback, there's no issue, but now I dont have my filter. The lack of an await, while not 100%, it looking to be a potential cause.

https://forum.radzen.com/t/sort-order-not-loading/13988

Originally created by @CoderJason123 on GitHub (May 4, 2023). Scenario: when Settings is bound, plus Filter is bound, the filter value gets overwritten. The async call to OnFilter at `ApplyFilter(RadzenDataGridColumn<TItem> column, bool closePopup = false), `in RadzenDataGrid.razor.cs is not awaited. ` OnFilter(new ChangeEventArgs() { Value = column.GetFilterValue() }, column, true); ` What happens is that a filter is applied then immediately removed by a second call. Overall I'm just trying to save and restore settings per the guidance, as well as trap what a person is filtering, so i can go to the db and filter it there first. The combination of Filter and bound settings is how to recreate it. When i remove the Filter event callback, there's no issue, but now I dont have my filter. The lack of an await, while not 100%, it looking to be a potential cause. [https://forum.radzen.com/t/sort-order-not-loading/13988](url)
Author
Owner

@enchev commented on GitHub (May 5, 2023):

I've merged your pull request: https://github.com/radzenhq/radzen-blazor/pull/959

@enchev commented on GitHub (May 5, 2023): I've merged your pull request: https://github.com/radzenhq/radzen-blazor/pull/959
Author
Owner

@CoderJason123 commented on GitHub (May 9, 2023):

@enchev - I tried this with the new version 4.10.4 and it's still an issue. The crux of the issue is as follows: when a handler has been added to catch setting changed (bind-Settings) as well as the filter, the filter is overwritten and returns to empty.

The entire reason for this process is to capture the filter so the data can be filtered in a backend api. Second, we want to store the settings in local storage. But there is something about the Filter handler that causes the grid to fire twice and overwrite the filter set.

@CoderJason123 commented on GitHub (May 9, 2023): @enchev - I tried this with the new version 4.10.4 and it's still an issue. The crux of the issue is as follows: when a handler has been added to catch setting changed (bind-Settings) as well as the filter, the filter is overwritten and returns to empty. The entire reason for this process is to capture the filter so the data can be filtered in a backend api. Second, we want to store the settings in local storage. But there is something about the Filter handler that causes the grid to fire twice and overwrite the filter set.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#839