MudDataGrid: Fix HierarchyColumn Expansion with Funcs#11292
MudDataGrid: Fix HierarchyColumn Expansion with Funcs#11292danielchalmers merged 6 commits intoMudBlazor:devfrom
Conversation
…unc is done properly.
…hies. Adjusted tests to only show 4 hierarchies when one is disabled.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #11292 +/- ##
=======================================
Coverage 91.35% 91.35%
=======================================
Files 466 466
Lines 14697 14726 +29
Branches 2853 2862 +9
=======================================
+ Hits 13426 13453 +27
- Misses 632 633 +1
- Partials 639 640 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
@ScarletKuro Any chance you can look at this one maybe this weekend? |
There was a problem hiding this comment.
Pull Request Overview
This PR moves the InitiallyExpandedFunc logic to MudDataGrid and routes it via the Template Column while also passing ButtonDisabledFunc so that hierarchy expansion and collapse respect disabled states. Key changes include adding new parameters to TemplateColumn, updating MudDataGrid expansion/collapse methods, and revising unit tests to account for the disabled state.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/MudBlazor/Components/DataGrid/TemplateColumn.cs | Added parameters InitiallyExpandedFunc and ButtonDisabledFunc |
| src/MudBlazor/Components/DataGrid/MudDataGrid.razor.cs | Added fields and methods to handle initial expansion and button disabled logic; updated hierarchy expansion methods |
| src/MudBlazor/Components/DataGrid/HierarchyColumn.razor.cs | Removed legacy initial expansion state handling and modified parameter types |
| src/MudBlazor/Components/DataGrid/HierarchyColumn.razor | Updated TemplateColumn usage to pass additional parameters |
| Unit Test Files | Adjusted expected counts and tests to reflect the new behavior with disabled items |
|
@TheGreenAirplane @willBrereton @Axium7 Hi, this PR should help your reported issues - If you can download the repo and give it a try it will help us ensure your apps work in the upcoming release! |
|
Instructions to create a test mudblazor nuget: 🔧 Testing a MudBlazor PR Locally in Your App
git clone https://github.com/MudBlazor/MudBlazor.git
cd MudBlazor
git fetch origin pull/11292/head:pr-branch
git checkout pr-branch
dotnet pack src/MudBlazor/MudBlazor.csproj -c Release -o ./LocalNuget -p:Version=8.0.0-custom
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="LocalMud" value="C:\Path\To\MudBlazor\LocalNuget" />
</packageSources>
</configuration>
<PackageReference Include="MudBlazor" Version="8.0.0-custom" />
dotnet restore
dotnet build✅ You’re now using the PR version of MudBlazor! |
|



Description
Moved InitiallyExpandedFunc logic to MudDataGrid by passing it through Template Column. Adjusted methods that calculate items to include this when supplied and logical.
Additionally passed ButtonDisabledfunc the same way, ensuring ExpandAll and CollapseAll Hierarchies ignore disabled.
Resolves #9681
Resolves #11289
Resolves #11291
How Has This Been Tested?
Additional unit tests and updated unit tests.
Visually in WASM and BSS.
Type of Changes
Checklist
dev).