Skip to content
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

fix: GridTemplateColumns no longer apply correct column widths in Datagrid #3356

Closed
JD2005L opened this issue Feb 13, 2025 · 4 comments · Fixed by #3357
Closed

fix: GridTemplateColumns no longer apply correct column widths in Datagrid #3356

JD2005L opened this issue Feb 13, 2025 · 4 comments · Fixed by #3357
Assignees
Labels
bug A bug closed:done Work is finished

Comments

@JD2005L
Copy link

JD2005L commented Feb 13, 2025

🐛 Bug Report

4.11.4 introduced gridtemplatecolumns bug, whereby the values specified are ignored and everything is getting an even 1fr. Downgrading to 4.11.3 restores functionality.

💻 Repro or Code Sample

Datagrid with GridTemplateColumns="1fr 1fr 2fr 4fr 1fr 1fr 1fr 1fr 0.5fr"

🤔 Expected Behavior

Columns should respect widths specified.

😯 Current Behavior

Resulting HTML receives overridden columns with 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr

🔦 Context

Custom column widths stopped working, everything became same width, makes summary columns hard to read and small data columns taking up too much space.

🌍 Your Environment

.NET V8 and Fluent UI Blazor library Version 4.11.4

@microsoft-github-policy-service microsoft-github-policy-service bot added the triage New issue. Needs to be looked at label Feb 13, 2025
@JD2005L JD2005L changed the title fix: [what is the issue?] in [where is the issue?] fix: GridTemplateColumns no longer apply correct column widths in Datagrid Feb 13, 2025
@brysageek
Copy link

Having same issue downgraded back to 4.11.3

@vnbaaij vnbaaij added needs: repro code or repository The provided description or code is insufficient to repro the issue and removed triage New issue. Needs to be looked at labels Feb 13, 2025
@vnbaaij
Copy link
Collaborator

vnbaaij commented Feb 13, 2025

Come on guys!

I need to have bit more context on when this is happening. Don't let us go hunt for when this occurs. Please supply reproduction code or a clear explanation/steps.

@vnbaaij vnbaaij self-assigned this Feb 13, 2025
@JD2005L
Copy link
Author

JD2005L commented Feb 13, 2025

Apologies, wasn't aware there was any confusion, happy to elaborate.

When I create a datagrid, I include the GridTemplateColumns property and specify the values, each results in the relative width of the table's columns. Here is example code:

<FluentDataGrid TGridItem="Job"
Class="w-100"
OnRowClick="@(e => DetailsNav(e.Item!))"
ShowHover="true"
NoTabbing="true"
Items="@filteredJobs.AsQueryable().OrderByDescending(x => x.CreatedDate)"
Pagination="pagination"
GridTemplateColumns="1fr 1fr 2fr 4fr 1fr 1fr 1fr 0.5fr"
HeaderCellAsButtonWithMenu="true"
MultiLine="true">

In 4.11.3 and previous, this results in the table rendering like this:

<table id="f54c755cc" class="fluent-data-grid grid w-100" style="grid-template-columns: 1fr 1fr 2fr 4fr 1fr 1fr 1fr 0.5fr;" aria-rowcount="6" b-ppmhrkw1mj="" _bl_9="">

In 4.11.4 the table that is rendered shows the grid-template-columns as 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr, it doesn't take the specified values from the FluentDataGrid property.

<table id="f54c755cc" class="fluent-data-grid grid w-100" style="grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;" aria-rowcount="6" b-ppmhrkw1mj="" _bl_9="">

Does this provide you with what you need?

@vnbaaij vnbaaij added bug A bug closed:done Work is finished and removed needs: repro code or repository The provided description or code is insufficient to repro the issue labels Feb 13, 2025
@vnbaaij
Copy link
Collaborator

vnbaaij commented Feb 13, 2025

Yes, that helps. Issue found and corrected. Will be in next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug closed:done Work is finished
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants