-
Notifications
You must be signed in to change notification settings - Fork 417
fix: DataGrid SelectColumn slow with more data and more columns #3253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you show/tell how that violation can be seen? With the example you posted, I do not see any significant slowdown occurring in selecting rows. How many rows do you have in your real world data? And if it is a pretty big number (>100), are you using Virtualization? And if not, why not? |
It's shown in Chrome developer tools console. The row count in our real world data is 64 and 7 columns so not massive. |
I do not see violations reported in Chrome when testing the sample code. Try running Chrome without extensions.
What render mode and can you provide a screenshot of the violations. Test with another Chromium-based browser like Edge. Is the site running locally or published? |
I still cannot reproduce the error on my end. Try Chrome in Incognito mode. |
Still happens in Incognito mode. |
Can you try with a new project ( no custom datagrid and no mud blazor). Need to rule out all other possibilities. |
This is how the projected started. The other pages came later to compare. |
Sorry... I cannot replicate the issue with the information you've provided. There must be something else in your project or environment at play. Can you provide a complete project as a repo or zip with all external dependencies removed such as mud blazor. |
Can you add some more columns to the grid. It seems it's partly due to the spec of the users machine and setup but eventually it'll show up. |
6 columns had to be added on (12th gen i7-12700 with 32gb mem) for it to show up. |
Look, while I acknowledge that you are seeing the message, are you actually perceiving slowness? It is not like we are going to drastically change the way the DataGrid is working/rendering. The grid is far too complex for that and we do not have capacity to take that on. Also, we have not received any other complaints about it being (too) slow. I'm not sure or clear what you want us to do with this report. |
Yes it is very noticeable to the user that it's slow. |
Are you seeing it with any of the demos on our site as well? |
No because your demo for the select column has 6 rows and 3 columns. |
Even then it does not show any messages and, more importantly, it does not act or feel slow. |
I can see the issue with this code using 100 rows and 8 columns but only if I choose 20x slowdown. <PageTitle>Data Grid</PageTitle>
<h1>Data Grid</h1>
<FluentDataGrid Items="@Items.AsQueryable()" ShowHover="true" TGridItem="DataRow">
<SelectColumn TGridItem="DataRow"
SelectMode="DataGridSelectMode.Multiple"
SelectFromEntireRow="false"
@bind-SelectedItems="@SelectedItems"/>
<PropertyColumn Width="100px" Property="@(p => p.Id)" Title="ID" />
<PropertyColumn Width="300px" Property="@(p => p.Column1)" />
<PropertyColumn Width="300px" Property="@(p => p.Column2)" />
<PropertyColumn Width="300px" Property="@(p => p.Column3)" />
<PropertyColumn Width="300px" Property="@(p => p.Column4)" />
<PropertyColumn Width="300px" Property="@(p => p.Column5)" />
<PropertyColumn Width="300px" Property="@(p => p.Column6)" />
<PropertyColumn Width="300px" Property="@(p => p.Column7)" />
</FluentDataGrid>
<div>
<b>SelectedItems:</b>
@String.Join("; ", SelectedItems.Select(p => p.Column1))
</div>
@code {
IEnumerable<DataRow> SelectedItems = [];
List<DataRow> Items = [];
const int ROW_COUNT = 100;
protected override void OnInitialized()
{
Items = GenerateData();
base.OnInitialized();
}
static List<DataRow> GenerateData()
{
List<DataRow> data = new List<DataRow>();
for (int i = 1; i <= ROW_COUNT; i++)
{
data.Add(new DataRow
{
Id = i,
Column1 = "Column1 Value",
Column2 = "Column2 Value",
Column3 = "Column3 Value",
Column4 = "Column4 Value",
Column5 = "Column5 Value",
Column6 = "Column6 Value",
Column7 = "Column7 Value"
});
}
return data;
}
public class DataRow
{
public int Id { get; set; }
public string Column1 { get; set; }
public string Column2 { get; set; }
public string Column3 { get; set; }
public string Column4 { get; set; }
public string Column5 { get; set; }
public string Column6 { get; set; }
public string Column7 { get; set; }
}
}
|
🐛 Bug Report
When using the SelectColumn with more than a few records in the grid the response time of the select box slows down. The more columns or the more rows the slower it gets.
Chrome reports [Violation] 'click' handler took 155ms for the below code. With my real world data this is over 600ms.
💻 Repro or Code Sample
Based off your sample but with more records and an extra column.
🤔 Expected Behavior
Responsive and snappy response. No timing violations.
🔦 Context
Using a grid with SelectColumn with real world amounts of data and columns is noticeably slow for the user.
🌍 Your Environment
The text was updated successfully, but these errors were encountered: