Skip to content

Fix Grid column title not visible when column is in a group#690

Merged
wimjongman merged 2 commits intomasterfrom
copilot/fix-grid-column-title-visibility
Mar 9, 2026
Merged

Fix Grid column title not visible when column is in a group#690
wimjongman merged 2 commits intomasterfrom
copilot/fix-grid-column-title-visibility

Conversation

Copy link
Contributor

Copilot AI commented Mar 7, 2026

paintColumnHeaderWithGroup() reuses the width variable for both the accumulated group width and the individual column width. After the while loop sums all visible column widths in the group, the inflated value is passed to the column header renderer's setBounds(), causing right-aligned titles and sort arrows to render off-screen.

  • Introduce a separate groupWidth variable for the group header width accumulation
  • width remains the individual column width, used correctly for the column header bounds
int width = column.getWidth(extraFill);
if (group != null) {
    if (group != previousPaintedGroup) {
        int groupWidth = width;
        // ...
        while (nextCol != null && nextCol.getColumnGroup() == group) {
            // ...
            groupWidth += nextCol.getWidth(extraFill);  // was: width +=
        }
        group.getHeaderRenderer().setBounds(x, 0, groupWidth, groupHeaderHeight);
    }
}
// ...
renderer.setBounds(x, y, width, height);  // now uses column width, not group width
Original prompt

This section details on the original issue you should resolve

<issue_title>Grid column title not visible</issue_title>
<issue_description>

width will contains the group width, but is also used as column width

as consequence, column header title with right align or the sort arrow are not visible.</issue_description>

<agent_instructions>Please enhance the snippet for this case so we can see the problem and propose a fix for the issue.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@lcaron Hi Fabrice

Can you provide a patch that solves the problem or a code sample ?

Thank you

Laurent</comment_new>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

In paintColumnHeaderWithGroup(), the 'width' variable was used for both
the accumulated group width and the individual column width. After the
while loop accumulated widths of all columns in the group, the inflated
value was incorrectly passed to the column header renderer's setBounds(),
causing right-aligned column titles and sort arrows to not be visible.

Introduce a separate 'groupWidth' variable for the group header width
accumulation, keeping 'width' as the individual column width.

Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix grid column title not visible issue Fix Grid column title not visible when column is in a group Mar 7, 2026
@laeubi laeubi marked this pull request as ready for review March 8, 2026 07:02
Copy link
Contributor

@laeubi laeubi left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me.

@laeubi laeubi requested review from lcaron and wimjongman March 8, 2026 07:03
@wimjongman wimjongman merged commit d0f66fd into master Mar 9, 2026
5 checks passed
@wimjongman wimjongman deleted the copilot/fix-grid-column-title-visibility branch March 9, 2026 10:13
@wimjongman wimjongman added this to the 3.4.0 milestone Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Grid column title not visible

3 participants