DataGrid with OData data source: 404 Error when updating data

I'm using a DataGrid and the OData data adaptor with these three classes:

public class Employee {
    public Guid EmployeeId { get; set; }
    public string Name { get; set; }
}

public class EmployeeTraining {
    public Guid EmployeeId { get; set; }
    public Guid TrainingId
    public bool Attended { get; set; }
}

public class Training {
    public Guid TrainingId { get; set; }
   public string Name { get; set; }
}

The edit template for the grid:

<Template>
    @{ var EmployeeTraining = (context as EmployeeTraining);}
    <label class="e-label-top">Attended:</label>
        <SfDropDownList TItem="string"
                TValue="Attended"
                Text="@EmployeeTraining.Attended.ToString()"
                @bind-Value="@EmployeeTraining.Attended"
                Placeholder="Attended"
                DataSource="@AttendedDropDown">
        </SfDropDownList>

</Template>

Everything displays correctly in the edit dialog, but when I click on Save I get the data grid throws the following error: "Response status code does not indicate success: 404 (Not Found)."


1 Reply

RN Rahul Narayanasamy Syncfusion Team September 22, 2021 03:36 AM UTC

Hi Scot, 

Greetings from Syncfusion. 

We have validated your query and we need some details regarding the reported problem to proceed this query further. Could you please share the below details. It will be helpful to validate and provide a better solution. 

  • Full Grid code snippets.
  • Whether did you used the mentioned classes with ForeignKey column in Grid?
  • Share your EditTemplate codes. You have mentioned that EditTemplate but you have shared column template codes. So please share the correct codes if possible.
  • Share the odata response structure of the your odata requests. Share a video demo showing the replication of the problem you are facing.
  • Whether the Put or Patch method is triggered while saving? Share those method codes.

Regards, 
Rahul 


Loader.
Up arrow icon