I have crated a new application using the syncfusion template (see BlazorApp2 attached) and added a grid with 2000 rows on to index.razor. If you do not hook into the RowSelected event there is no delay when selecting a new (it works ok). If you hook into the RowSelected event it takes over 3 seconds before the row is highlighted when clicking on a new row. Which is unacceptable.
I have modified an application found on your web site (See BlazorApp1) with the same index.razor page and this works fine when hooking into RowSelected.
BlazorApp2 uses WebAssemblyHostBuilder in program.cs where as BlazorApp1 uses WebApplication, is this the reason why BlazorApp1 works and BalzorApp2 does not?
How can we fix this problem within BlazorApp2 without reverting to what I assume is an older way of starting the application (assuming this is the cause)
Greetings from Syncfusion support.
We have checked your query and we would like to inform that when a callback method is assigned to the grid events, then the StateHasChanged will be called in parent component of the grid automatically once the event is completed. So we suggest you to prevent this re-rendering of the grid component by setting PreventRender property of the corresponding event argument as true in WASM for better performance. We have modified the shared sample. Kindly check the attached sample and code snippet for your reference.
private void OnRowSelected(RowSelectEventArgs<Order> args)
args.PreventRender = true; //without this, you may see noticeable delay in selection with 75 rows in grid.
Also we have documented this topic in our below UG section. Kindly check the attached UG for additional information.
Please let us know if you have any concerns.
Setting PreventRender to false has solved the issue. Apologizes for not seeing this in the documentation.
Thanks for the update.
We are glad to hear that the reported issue has been resolved. Kindly get back to us if you have further queries. As always we will be happy to assist you.
If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.