Hey,
I have a grid with columns that are being generated dynamically on load based on a dynamic object. Everything is loading ok, but for some reason the AutoFitAllColumnsAsync doesn't seem to be working. I can't even resize the individual columns using the mouse.
I am loading 117 pages (15 rows per page) of data, but the sorting works fine. Is there any reason you can think of that the resizing wouldn't work?
Here is my grid code
TelerikGrid @ref="@Grid"
Data="@GridData"
Pageable="true"
@bind-PageSize="@PageSize"
Sortable="true"
FilterMode="GridFilterMode.None"
Resizable="true"
Reorderable="true"
EditMode="GridEditMode.None"
Navigable="true"
Class="slim-grid-paddings">
<GridSettings>
<GridPagerSettings InputType="PagerInputType.Input"
PageSizes="@_appSettings.PageSizes"
ButtonCount="5"
Adaptive="true">
</GridPagerSettings>
</GridSettings>
<GridToolBarTemplate>
<GridCommandButton Command="custom" Icon="@FontIcon.MaxWidth" Size="sm" OnClick="@(() => Grid.AutoFitAllColumns())">Auto-fit</GridCommandButton>
<span class="k-toolbar-spacer"></span>
<GridCommandButton Command="ExcelExport" Icon="@FontIcon.FileExcel" Size="sm">To Excel</GridCommandButton>
<span title="Searches the items in the below grid." class="tooltip">
<GridSearchBox DebounceDelay="200" Placeholder="Search" Size="sm" Fields="@SearchFields"></GridSearchBox>
</span>
</GridToolBarTemplate>
<GridColumns>
@if (GridData != null && GridData.Any())
{
var firstItem = GridData.First();
var dictionaryItem = (IDictionary<string, object>)firstItem;
var fields = dictionaryItem.Keys;
foreach (var item in dictionaryItem)
{
<GridColumn Field="@item.Key" FieldType="@typeof(string)"></GridColumn>
}
}
</GridColumns>
</TelerikGrid>