-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
MudDataGrid: Correctly render initially expanded rows #10133
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
MudDataGrid: Correctly render initially expanded rows #10133
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #10133 +/- ##
==========================================
- Coverage 91.18% 91.18% -0.01%
==========================================
Files 411 411
Lines 12483 12480 -3
Branches 2432 2431 -1
==========================================
- Hits 11383 11380 -3
Misses 556 556
Partials 544 544 ☔ View full report in Codecov by Sentry. |
|
Was just about to fix it.... that's what you get for trying quick edits on your phone xD |
|
Thanks! |
|
A quick question, does this fixes #9681 as well or not? upd: Nvm, i think it doesn't |
|
It does not. |
The problem is that when you add new items to the data grid on the fly, the I know how to fix it in a reactive way. You can implement a pub/sub using either |
|
Ok, maybe it was my misunderstanding of the initially expanded feature. I took it to mean when the grid is initially loaded/rendered the specified rows should be expanded (which it currently does). From your explanation though, it's not just when the grid is initially loaded but whenever data is added it needs to check if the newly added rows should render expanded or not. |
|
Hello, Is this fix in progress? Seems like it's still an outstanding issue - https://try.mudblazor.com/snippet/mkwIlcQNCoZdniOV |
This fix was implemented in v8. TryMud uses v7. You'd need to test using a v8 implementation to confirm. |
|
I tried v8.0.0-preview.6 locally and still seeing the issue. |
|
I think the issue here is: private IEnumerable<Element> Elements = new List<Element>();
protected override async Task OnInitializedAsync()
{
Elements = await httpClient.GetFromJsonAsync<List<Element>>("webapi/periodictable");
}You have two states: initially, the DataGrid has empty elements, and then, after receiving the data, it transitions to the second state. Unfortunately, the |
|
I guess accepting |
Thank you for the response. Is there already work underway to implement this? |
|
I don't believe this is being worked on at the moment |
Description
The current implementation adds the initially expanded items to the
OpenHierarchiescollection of theCellContext. This however, doesn't cause the DataGrid to re-render. The update, instead, callsToggleHierarchyVisibilityForItemAsyncfor each item, which executes a method on the DataGrid and forces a re-renderResolves #10104
How Has This Been Tested?
Updated existing unit test to confirm that that row is actually expanded in the markdown.
Type of Changes
Checklist
dev).