Skip to content

MudDataGrid: Add XML comment to ToggleHierarchyVisibilityAsync#11198

Merged
ScarletKuro merged 2 commits intoMudBlazor:devfrom
MiroslavKabat:feature/ToggleHierarchyVisibilityAccessModifiers
Apr 21, 2025
Merged

MudDataGrid: Add XML comment to ToggleHierarchyVisibilityAsync#11198
ScarletKuro merged 2 commits intoMudBlazor:devfrom
MiroslavKabat:feature/ToggleHierarchyVisibilityAccessModifiers

Conversation

@MiroslavKabat
Copy link
Contributor

@MiroslavKabat MiroslavKabat commented Apr 15, 2025

Description

Fixes: #11145
Exposed the MudDataGrid<T>.ToggleHierarchyVisibilityAsync method by changing its access modifier from internal to public, enabling external use and improving the component's flexibility.

Motivation

While integrating MudDataGrid into my application, I needed to toggle the hierarchy visibility in response to a RowClick event. Since there was no public method available, I resorted to using reflection to access ToggleHierarchyVisibilityAsync. This workaround functions correctly, but the method serves a clear purpose externally and would be more appropriately marked as public.

How Has This Been Tested?

The method's functionality is already covered by existing tests. No new test cases were required as this change only exposes existing behavior.

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

- Changed the access modifier of the method from `internal` to `public` to allow external access for broader usability.
- Added XML documentation to the `ToggleHierarchyVisibilityAsync` method to improve code clarity and provide detailed usage information.
@github-actions github-actions bot added docs Updates/improvements to project documentation that do not affect core library logic enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library PR: needs review labels Apr 15, 2025
@Anu6is Anu6is requested a review from ScarletKuro April 16, 2025 11:26
@ScarletKuro
Copy link
Member

I think this is done in #11181 already

@Anu6is
Copy link
Contributor

Anu6is commented Apr 16, 2025

Indeed it is

@ScarletKuro
Copy link
Member

Closing, I just merged #11181 which contains this change already.
Thanks anyway!

@MiroslavKabat
Copy link
Contributor Author

I don't understand why it was closed by @ScarletKuro. It was approved and merged because it extends the previous PR, and this PR adds a comment to the now-public method. It should be approved as it was before by @Anu6is .

@ScarletKuro ScarletKuro reopened this Apr 21, 2025
@ScarletKuro ScarletKuro changed the title Changed ToggleHierarchyVisibilityAsync access modifier to public MudDataGrid: Add Xml comments to ToggleHierarchyVisibilityAsync Apr 21, 2025
@ScarletKuro ScarletKuro removed enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library PR: needs review labels Apr 21, 2025
@ScarletKuro ScarletKuro changed the title MudDataGrid: Add Xml comments to ToggleHierarchyVisibilityAsync MudDataGrid: Add XML comment to ToggleHierarchyVisibilityAsync Apr 21, 2025
@ScarletKuro ScarletKuro merged commit 4bfd7e5 into MudBlazor:dev Apr 21, 2025
2 checks passed
@sonarqubecloud
Copy link

@sonarqubecloud
Copy link

Please retry analysis of this Pull-Request directly on SonarQube Cloud

@versile2
Copy link
Contributor

versile2 commented Apr 28, 2025

I'm adding a note here so we can all have a future reference

Note:

ToggleHierarchyVisibilityAsync uses <T> Item as a parameter, if the user does not implement an override Equals and GetHashCode in their <T> object this method will not work. I suspect that's why it was never public. Additionally it should probably respect the built in Comparer if overridden of the DataGrid but it does not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Updates/improvements to project documentation that do not affect core library logic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make MudDataGrid ToggleHierarchyVisibilityAsync public

4 participants