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 usage in FluentDataGrid with SelectColumn #2053

Closed
gkizior opened this issue May 15, 2024 · 0 comments · Fixed by #2060
Closed

fix: GridTemplateColumns usage in FluentDataGrid with SelectColumn #2053

gkizior opened this issue May 15, 2024 · 0 comments · Fixed by #2060
Labels
status:in-progress Work is in progress

Comments

@gkizior
Copy link
Contributor

gkizior commented May 15, 2024

Cannot use GridTemplateColumns property on FluentDataGrid with SelectColumn

🐛 Bug Report

Stack Trace:

System.Exception: You can use either the 'GridTemplateColumns' parameter on the grid or the 'Width' property at the column level, not both.
at Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid1.FinishCollectingColumns() in /_/src/Core/Components/DataGrid/FluentDataGrid.razor.cs:line 338 at Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid1.b__150_1(RenderTreeBuilder __builder3) in //src/Core/Components/DataGrid/FluentDataGrid.razor:line 12
at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
at Microsoft.FluentUI.AspNetCore.Components.DataGrid.Infrastructure.Defer.BuildRenderTree(RenderTreeBuilder builder) in /
/src/Core/Components/DataGrid/Infrastructure/Defer.cs:line 26
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)

💻 Repro or Code Sample

<FluentDataGrid Loading=@IsLoading EmptyContent=@EmptyContent Items="@..." GridTemplateColumns=@MyTemplateColumns ShowHover=true TGridItem="...">
   <SelectColumn TGridItem="..." SelectMode=@DataGridSelectMode.Single @bind-SelectedItems="@SelectedItems" />
   ...
</FluentDataGrid>

🤔 Expected Behavior

I would expect that I could use either GridTemplateColumns or Width properties. But right now only Width works when a FluentDataGrid has a SelectColumn

🔦 Context

🌍 Your Environment

  • .NET 8 and Fluent UI Blazor library Version 4.7.2
@microsoft-github-policy-service microsoft-github-policy-service bot added the triage New issue. Needs to be looked at label May 15, 2024
@vnbaaij vnbaaij linked a pull request May 16, 2024 that will close this issue
@vnbaaij vnbaaij added status:in-progress Work is in progress and removed triage New issue. Needs to be looked at labels May 16, 2024
vnbaaij added a commit that referenced this issue May 23, 2024
* Fix #2055 by including ItemsProvider in the logic

* Also fix #2053 by excluding SelectColumns from GridTemplateColumns/Width check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:in-progress Work is in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants