fluentui-blazor icon indicating copy to clipboard operation
fluentui-blazor copied to clipboard

fix: GridTemplateColumns usage in FluentDataGrid with SelectColumn

Open gkizior opened this issue 1 year ago • 0 comments

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.<BuildRenderTree>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="..." [email protected] @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

gkizior avatar May 15 '24 14:05 gkizior