DataGrid Sorting

I get errors when trying to use sorting and cant figure out why
any one how can help? Thanks in advance :slight_smile:
when ever I try to us sorting in my datagrid i get these errors:

2022-09-06 10:06:55.453 [WRN] Unhandled exception rendering component: "Enum type 'Operations' not found"
Enum type 'Operations' not found (at index 18)
2022-09-06 10:06:55.455 [ERR] Unhandled exception in circuit '"IP5eLUyxbDXB0v5oP265lvL23znUURMvW7BL1Och6Vg"'.
Enum type 'Operations' not found (at index 18)
2022-09-06 10:06:55.489 [WRN] Unhandled exception rendering component: "Cannot access a disposed object."
System.ObjectDisposedException: Cannot access a disposed object.
   at Microsoft.AspNetCore.Components.RenderTree.ArrayBuilder`1.ThrowObjectDisposedException()
   at Microsoft.AspNetCore.Components.RenderTree.ArrayBuilder`1.GrowBuffer(Int32 desiredCapacity)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange`1 oldTree, ArrayRange`1 newTree)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
2022-09-06 10:06:55.497 [ERR] Unhandled exception in circuit '"IP5eLUyxbDXB0v5oP265lvL23znUURMvW7BL1Och6Vg"'.
System.ObjectDisposedException: Cannot access a disposed object.
   at Microsoft.AspNetCore.Components.RenderTree.ArrayBuilder`1.ThrowObjectDisposedException()
   at Microsoft.AspNetCore.Components.RenderTree.ArrayBuilder`1.GrowBuffer(Int32 desiredCapacity)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange`1 oldTree, ArrayRange`1 newTree)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

and the code looks like this:

                    <RadzenDataGrid AllowMultiColumnSorting="true" ShowMultiColumnSortingIndex="true" AllowPaging="true" AllowSorting="true" PageSize="10"
                                    AllowFiltering="true" AllowColumnResize="true" FilterMode="FilterMode.Advanced"
                                    @ref="operationsGrid" EditMode="DataGridEditMode.Multiple" Data="@operations" TItem="@UiOperationListVm" RowUpdate="@OnUpdateOperationRow" RowCreate="@OnCreateRowOperation"
                                    >
                        <Columns>
                            <RadzenDataGridColumn TItem="UiOperationListVm" Property="Operation.Id" Title="ID" Sortable="false" Filterable="false" />

                            <RadzenDataGridColumn TItem="UiOperationListVm" Property="Operations.Name" Title="Name">
                                <EditTemplate Context="selectedOperation">
                                    <RadzenNumeric @bind-Value="selectedOperation.Name" Style="width:100%; display: block;" />
                                </EditTemplate>
                            </RadzenDataGridColumn>

                            <RadzenDataGridColumn TItem="UiOperationListVm" Property="Operations.Description" Title="Description">
                                <EditTemplate Context="selectedOperation">
                                    <RadzenTextBox @bind-Value="selectedOperation.Description" Style="width:100%; display: block;" />
                                </EditTemplate>
                            </RadzenDataGridColumn>

                            <RadzenDataGridColumn TItem="UiOperationListVm" Property="Operations.OperationType.Description" Title="OperationType" Width="280px" Sortable="false" Filterable="false">
                                <EditTemplate Context="selectedOperation">
                                    <RadzenDropDown @bind-Value="selectedOperation.OperationTypeName" Data="@operationTypeListVm" TextProperty="Description" ValueProperty="Name" Style="width:100%; display: block;" />
                                </EditTemplate>
                            </RadzenDataGridColumn>



                            <RadzenDataGridColumn TItem="UiOperationListVm" Context="uiUpdateOperation" Filterable="false" Sortable="false" TextAlign="TextAlign.Center" Width="120px">
                                <Template Context="selectedOperation">
                                    <RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Class="m-1" Click="@(args => EditOperationRow(selectedOperation))" @onclick:stopPropagation="true">
                                    </RadzenButton>
                                </Template>
                                <EditTemplate Context="selectedOperation">
                                    <RadzenButton Icon="check" ButtonStyle="ButtonStyle.Primary" Class="m-1" Click="@((args) => UpdatedOperationRow(selectedOperation))">
                                    </RadzenButton>
                                    <RadzenButton Icon="close" ButtonStyle="ButtonStyle.Light" Class="m-1" Click="@((args) => CancelOperationEdit(selectedOperation))">
                                    </RadzenButton>
                                </EditTemplate>
                            </RadzenDataGridColumn>


                            <RadzenDataGridColumn TItem="UiOperationListVm" Context="uiUpdateOperation" Filterable="false" Sortable="false" TextAlign="TextAlign.Center" Width="60px">
                                <Template Context="selectedOperation">
                                    <RadzenButton ButtonStyle="ButtonStyle.Danger" Icon="delete" Size="ButtonSize.Small" Class="m-1" Click="@(args => DeleteOperationRow(selectedOperation))" @onclick:stopPropagation="true">
                                    </RadzenButton>
                                </Template>
                                <EditTemplate Context="selectedOperation">
                                    <RadzenButton ButtonStyle="ButtonStyle.Danger" Icon="delete" Size="ButtonSize.Small" Class="m-1" Click="@(args => DeleteOperationRow(selectedOperation))">
                                    </RadzenButton>
                                </EditTemplate>
                            </RadzenDataGridColumn>
                        </Columns>
                    </RadzenDataGrid>

Make sure your model has an Operations property.