Hi,
I have a DataGrid which looks approximately like the following:
<SfGrid TValue="Account" AllowPaging="true" AllowFiltering="true" AllowSorting="true" AllowTextWrap="true" AllowResizing="true" ShowColumnChooser="true" Toolbar="@(new string[] { "Add", "Edit", "Delete", "ColumnChooser"})">
<SfDataManager AdaptorInstance="@typeof(AccountAdapter)" Adaptor="Adaptors.CustomAdaptor"></SfDataManager>
<GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.Menu"></GridFilterSettings>
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Dialog" ShowDeleteConfirmDialog="true"></GridEditSettings>
<GridColumns>
<GridColumn Field="@nameof(Account.Id)" HeaderText="ID" TextAlign="TextAlign.Center" AllowFiltering="false" IsPrimaryKey="true" Width="300px"></GridColumn>
<GridColumn Field="@nameof(Account.Name)" HeaderText="Name" Type="ColumnType.String"></GridColumn>
<GridColumn Field="@nameof(Account.EMail)" HeaderText="EMail" Type="ColumnType.String"></GridColumn>
<GridColumn Field="@nameof(Account.PhoneNumber)" HeaderText="Phone Number" Type="ColumnType.String"></GridColumn>
<GridColumn Field="@nameof(Account.Description)" HeaderText="Description" Width="28%" Type="ColumnType.String"></GridColumn>
</GridColumns>
</SfGrid>
If I am hiding a column with the column chooser, resizing another column with the column chooser and showing the column again it doesn't show up. Instead, my whole grid gets stretched apart horizontally.
I've tried to investigate this and as far as I can see the column is not showing up because it's width in the <colgroup> element is set to 0px. The stretching comes from the wrapping of the column with 0px width.
Now my question is where does this behavior come from? Is this intended? And how can I prevent this?
Additional information:
- Platform: Blazor WebAssembly
- Framework: .NET 5 (5.0.202)
- Installed Syncfusion NuGet Package: Syncfusion.Blazor.Grid (18.4.0.42)