-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Docs: Add brief DataGrid multi-selection documentation note #11810
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
Conversation
…selection requirements Co-authored-by: danielchalmers <[email protected]>
Co-authored-by: danielchalmers <[email protected]>
|
@copilot |
…move verbose examples Co-authored-by: danielchalmers <[email protected]>
Addressed all feedback in commit 54e4eda:
The verbose Selection section has been removed and replaced with a brief note. The detailed expansion panel example has been simplified to just a small alert about the requirement. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #11810 +/- ##
=======================================
Coverage 91.33% 91.33%
=======================================
Files 468 468
Lines 14766 14766
Branches 2874 2874
=======================================
Hits 13487 13487
Misses 636 636
Partials 643 643 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
<MudAlert Severity="Severity.Info" Dense="true" Class="mt-3"> | ||
<strong>Multi-selection requirement:</strong> Custom objects must override <CodeInline>Equals</CodeInline> and <CodeInline>GetHashCode</CodeInline> methods. | ||
The Element model implements these for proper HashSet functionality. | ||
</MudAlert> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep alerts out of examples. Since you already have a written note on the main page, you can remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the alert from the example in commit b774b0c. The selection documentation is now only on the main DataGrid page as requested.
<MudDataGrid Items="@Elements.Take(4)"> | ||
<MudDataGrid T="Element" MultiSelection="true" Items="@Elements.Take(4)"> | ||
<Columns> | ||
<SelectColumn T="Element" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the explicit T="Element" parameter in commit b774b0c. You're right, it's unnecessary since the type is inferred from the Items property.
@inject HttpClient httpClient | ||
|
||
<MudDataGrid Items="@Elements.Take(4)"> | ||
<MudDataGrid T="Element" MultiSelection="true" Items="@Elements.Take(4)"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
T="Element"
is implied by Items
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected - removed the explicit T="Element" parameter in commit b774b0c since it's implied by the Items property.
@copilot I reviewed it |
Co-authored-by: danielchalmers <[email protected]>
|
@copilot drop all changes to examples and only keep the selection note you added to the data grid page |
Co-authored-by: danielchalmers <[email protected]>
This PR adds a concise documentation note to inform users about MudDataGrid multi-selection requirements for custom objects.
Changes Made
Added a brief selection note to the Advanced Data Grid section documenting that custom objects require overriding
Equals
andGetHashCode
methods for multi-selection functionality, with an alternative mention of using a customComparer
parameter.Problem Solved
Users encountering multi-selection issues with custom models were unaware that
Equals
andGetHashCode
methods need to be overridden. While the Element model in examples already had proper implementation with explanatory comments, this requirement wasn't documented in the main DataGrid documentation.The documentation is intentionally brief and integrated into the existing Advanced Data Grid section to provide essential information without adding verbosity.
Fixes #11806.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.