-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
MudDataGrid: Fix generated EditTemplates not inheriting their column's culture #11931
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: Fix generated EditTemplates not inheriting their column's culture #11931
Conversation
… MudDataGrid component
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.
Code Review
This pull request correctly adds the Culture property to the automatically generated EditTemplates in MudDataGrid, ensuring they inherit the culture from their column. This aligns the behavior of edit templates with that of cell templates. The associated test changes are also appropriate. I've added a couple of minor suggestions to improve code formatting and consistency.
| <MudTextField T="string" Label="@column.Title" Value="@cell._valueString" ValueChanged="@cell.StringValueChangedAsync" Margin="@Margin.Dense" | ||
| Required=column.Required Variant="@Variant.Outlined" Disabled="@(!column.Editable || ReadOnly)" Class="mt-4" /> | ||
| Required=column.Required Variant="@Variant.Outlined" Disabled="@(!column.Editable || ReadOnly)" Class="mt-4" Culture="@column.Culture" /> | ||
| } | ||
| else if (TypeIdentifier.IsNumber(propertyType)) | ||
| { | ||
| <MudNumericField T="double?" Label="@column.Title" Value="@cell._valueNumber" ValueChanged="@cell.NumberValueChangedAsync" Margin="@Margin.Dense" | ||
| Required=column.Required Variant="@Variant.Outlined" Disabled="@(!column.Editable || ReadOnly)" Class="mt-4" /> | ||
| Required=column.Required Variant="@Variant.Outlined" Disabled="@(!column.Editable || ReadOnly)" Class="mt-4" Culture="@column.Culture" /> | ||
| } |
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.
| ValueChanged="@cell.NumberValueChangedAsync" | ||
| Margin="@Margin.Dense" Style="margin-top:0" | ||
| Required=column.Required Variant="@Variant.Text" Culture="@column.Culture"/> | ||
| Required=column.Required |
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.
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.
Fixed
Description
This PR makes the automatically generated EditTemplates inherit their enclosing Columns' Culture. This behaviour would mirror the automatically generated CellTemplates as they already inherit the Culture of the columns they are defined in.
Type of Changes
Checklist
dev).