Hi,
I was using DataGrid component with selection as BlazorServer project and it was just fine.
On my new project I created Blazor WebAssembly project and when I start using selection it looks like selection take me a lot of time - most between 700ms and 1400ms. In contrast with blazor server project when the selection is almost immediate.
I am not doing anything On SelectRow method.
The problem persist on both version of .NET Core 5 and 6.
I am adding content of the razor file and part of the code behind file to clarify the problem
<RadzenSplitterPane Size="80%">
<div class="row">
<div class="col-12 sbc-grid-split-l">
<RadzenDataGrid AllowSorting="true"
AllowColumnResize="true"
AllowFiltering=" true"
ColumnWidth="105px"
Data="@Data"
@ref="Grid"
TItem="Customer"
LoadData="@LoadData"
Count="@DataCount"
SelectionMode="DataGridSelectionMode.Single"
Style="height: calc(100vh - 10.5rem); "
RowSelect="@((sc)=>{ SelectedCustomer = sc;})"
RowUpdate="@CustomerRowUpdate">
<Columns>
<RadzenDataGridColumn TItem="Customer" Property="CustomerNo"
Title="CustomerNo" Frozen="true"
SortProperty="CustomerNo" />
...
Total 24 columns
</Columns>
</RadzenDataGrid>
</div>
</div>
</RadzenSplitterPane>
</RadzenSplitter>
And the LoadData is
protected async Task LoadData(LoadDataArgs args) {
DateTime rptDate = new DateTime(2021, 6, 30);
string filter = string.IsNullOrEmpty(Filter) ? "no" : Filter;
var result = await Http.GetFromJsonAsync<Tuple<IEnumerable<Customer>, int>>(
$"Customers/GetCustomers/{rptDate:yyyy-MM-dd}/{0}/{25}/{filter}/no/me");
Data = result.Item1;
DataCount = result.Item2;
}
Can the problem be related to the size of the controls in the page( 25 columns and 25 rows)?
We can't reproduce such a problem. There isn't an inherent performance issue related to web-assembly.
You can try removing code/components until you find what is causing the performance problem. Alternatively you could send us your application to info@radzen.com (in case you have a Radzen Professional subscription).
Hi,
Thank for your time and support.
I followed your advice and start removing columns. It looks like the problem is related to the count of columns shown. The same grid with just only 4 columns left show very different picture. The Click event now take only 200 ms.
So it looks like it is not good to have grid with a lot of columns.
Is there an update or a workaround for this? Displaying more than a few columns in a grid has a severe performance impact.
Not sure how many columns are more than a few in your case however in this thread I've tested recently with 20:
Did anyone find a solution? I have the same problem on Blazor WASM where it takes about 4 seconds to select cells. On Blazor Server there is no delay. I think it has something to do with the Key and Click events.