Skip to content

Conversation

@benditorok
Copy link
Contributor

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

  • 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 style of this project.
  • I've added relevant tests or confirmed existing ones.

@mudbot mudbot bot added bug Unexpected behavior or functionality not working as intended localization Translations, locale formats, RTL layout, or pluralization labels Oct 3, 2025
@mudbot mudbot bot changed the title MudDataGrid: Fix generated EditTempates not inheriting their column's culture (#11091) MudDataGrid: Fix generated EditTemplates not inheriting their column's culture Oct 3, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

Comment on lines 298 to 305
<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" />
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These lines are quite long, which can impact readability. For better maintainability and consistency with formatting elsewhere in this file, consider breaking the attributes for MudTextField and MudNumericField onto multiple lines.12

Style Guide References

Footnotes

  1. The style guide recommends writing readable and maintainable code. Breaking long lines improves readability.

  2. The pull request guidelines require code to be properly formatted. Consistent formatting improves code quality.

ValueChanged="@cell.NumberValueChangedAsync"
Margin="@Margin.Dense" Style="margin-top:0"
Required=column.Required Variant="@Variant.Text" Culture="@column.Culture"/>
Required=column.Required
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line has a trailing whitespace which seems unintentional. Please remove it to ensure the code is properly formatted.1

                                              Required=column.Required

Style Guide References

Footnotes

  1. The pull request guidelines require code to be properly formatted. Trailing whitespace is a formatting issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

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

Labels

bug Unexpected behavior or functionality not working as intended localization Translations, locale formats, RTL layout, or pluralization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants