I get error when I add or update Data grid with Odata

I have data grid with Odata and ODataV4Adaptor and i get all data but when I add or edit item i get this error 

"This JsonSerializerOptions instance is read-only or has already been used in serialization or deserialization."

This is my grid: "

    <SfGrid ID="Grid" TValue="Scout" AllowPaging="true" AllowFiltering="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })">

        <GridSearchSettings IgnoreCase="true"></GridSearchSettings>

        <GridEvents TValue="Scout" OnActionFailure="ActionFailureHandler"></GridEvents>

        <SfDataManager Url="@DataAdress" Adaptor="Adaptors.ODataV4Adaptor"></SfDataManager>

        <GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Normal"></GridEditSettings>

    <GridColumns>

        <GridColumn Field=@nameof(Scout.Id) Visible="false" HeaderText="Scout ID" IsIdentity="true" IsPrimaryKey="true" TextAlign="TextAlign.Right" Width="20"></GridColumn>

            <GridColumn Field=@nameof(Scout.Name) HeaderText="Scout Name" TextAlign="TextAlign.Left" Width="150"></GridColumn>

        <GridColumn Field=@nameof(Scout.ScoutingOrganization) HeaderText="Organization" Type="ColumnType.String" TextAlign="TextAlign.Left" Width="150"></GridColumn>

    </GridColumns>

</SfGrid>

"

Code behind : "

        private string DataAdress = "";

        protected override void OnInitialized()

        {

            DataAdress = "https://localhost:7238/odata/Scout";

        }

        public void ActionFailureHandler(FailureEventArgs args)

        {

            var nesto = args;

        }


        public class Scout

        {

            public int Id { get; set; }


            public string? Name { get; set; }


            public string? ScoutingOrganization { get; set; }

        }

"


2 Replies

MS Monisha Saravanan Syncfusion Team December 12, 2023 09:08 AM UTC


Hi Ivan,


We have confirmed this as an issue and logged the defect report “Exception throws while performing CRUD operation in OdataV4” for the same. Thank you for taking time to report this issue and helping us to improve our product. At Syncfusion, we are committed to fix all validated defects (subject to technological feasibility and Product Development Life Cycle) and this fix will be included in our upcoming patch release which is expected to be rolled out on or before 27th  December, 2023.


You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.       


https://www.syncfusion.com/feedback/49182/exception-throws-while-performing-crud-operation-in-odatav4


Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization”



Regards,

Monisha




MS Monisha Saravanan Syncfusion Team January 2, 2024 03:48 AM UTC

Hi Ivan,


We are glad to announce that we have included the fix for the issue “Exception throws while performing CRUD operation in OdataV4” in our 23.1.43 release.  So please upgrade to our latest version of Syncfusion NuGet package to resolve the reported issue. Please find the Nuget package for latest fixes and features from below.


Nuget : https://www.nuget.org/packages/Syncfusion.Blazor.Grid


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 


Regards,

Monisha S


Loader.
Up arrow icon