Getting "Index was outside the bounds of the array" error when editing the Detail grid.

Answer:

We suggest you to ensure to set the IsPrimaryKey to an unique value column in the Details view Grid to perform editing in DataGrid. You can refer the below documentation and codes for more details.

https://blazor.syncfusion.com/documentation/datagrid/editing/

Here is the code snippet for your reference,

<SfGridDataSource="@SelectedHouse.Features"

        Toolbar="@(newList<string>() { "Edit", "Update", "Cancel" })">

    ...

    <GridColumns>

        <GridColumnField=@nameof(FeatureObject.Description)HeaderText="Feature"Width="110"

                    AllowEditing="false"IsPrimaryKey="true">GridColumn>

        <GridColumnField=@nameof(FeatureObject.Weight)HeaderText="Weight"Width="110"

                    EditType="EditType.NumericEdit">GridColumn>

    GridColumns>

SfGrid>



Loader.
Up arrow icon