Skip to content

Fix. Quickgrid PropertyColumn Align property doesn't work with Align.Right #62707

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

Merged
merged 4 commits into from
Jul 17, 2025

Conversation

dariatiurina
Copy link
Contributor

@dariatiurina dariatiurina commented Jul 14, 2025

Fix. Quickgrid PropertyColumn Align property doesn't work with Align.Right

Description

This pull request refactors and fixes the column alignment and justification styles in the QuickGrid.razor.css file.

Changes:

  • Added new styles for .col-justify-start .col-options and td.col-justify-start to support left-aligned column options and text.
  • Introduced td.col-justify-right and td.col-justify-left styles for explicit right and left text alignment.

Reasoning for change:

In

private static string? ColumnClass(ColumnBase<TGridItem> column) => column.Align switch

Blazor assigns css classes based on the Align parameter that user has set. However, in the

there were no implementation for 3 out of existing 5 parameter options. This PR fixes implements missing options.

Fixes #50029

@dariatiurina dariatiurina self-assigned this Jul 14, 2025
@Copilot Copilot AI review requested due to automatic review settings July 14, 2025 13:44
@dariatiurina dariatiurina requested a review from a team as a code owner July 14, 2025 13:44
@github-actions github-actions bot added the area-blazor Includes: Blazor, Razor Components label Jul 14, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request fixes a bug where the QuickGrid PropertyColumn's Align property doesn't work correctly with right alignment (Align.Right). The fix refactors CSS styles to properly support column alignment and adds missing styles for consistent column options positioning.

  • Reorganizes existing CSS rules for better logical grouping
  • Adds support for col-justify-start styles for left alignment consistency
  • Introduces explicit col-justify-right and col-justify-left styles for direct alignment control
  • Adds RTL (right-to-left) support for the new col-justify-start styles

Copy link
Member

@oroztocil oroztocil left a comment

Choose a reason for hiding this comment

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

I tried it in a sample project and the Align.Right property is working now 👍

}

td.col-justify-start {
text-align: left;
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We use in .col-justify-end { text-align: right }. So I just did this class by the same pattern as an existing class.

Copy link
Member

Choose a reason for hiding this comment

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

hmm. Maybe I'm not fully understanding how this works. But the start and end classes are typically used/defined for usage with logical properties, with the idea, that they automatically adapt to right to left languages like arabic, hebrew and so on

@dariatiurina dariatiurina merged commit 292fe52 into dotnet:main Jul 17, 2025
28 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview7 milestone Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quickgrid PropertyColumn Align property doesn't work with Align.Right
4 participants