Entity Framework core Master/Detail grid not invoking Update in detail grid

Using DotNet 7  EFcore v7   Syncfusion v 23.1.41


I have server side Blazor app using a data grid with a nested grid.   I am using  EF v7. I am using  the recommended DAL/WebAPI paradigm to access the data.   I have EditMode set to normal.     I have the detail toolbar set to  "Add", "Edit", "Delete", "Cancel", "Update"

All works fine except I cannot update detail records (master records work fine).  When I press Update no WebAPI call is fired.    Add correctly generates a blank record, delete correctly fires the delete WebAPI call  and cancel correctly works but Update does nothing.


 What do you think I may have got wrong?  How should I go about debugging this?


M


3 Replies

NP Naveen Palanivel Syncfusion Team November 2, 2023 03:42 PM UTC


Hi Martin,


Before proceeding further with your requirement kindly share the below details to validate further at our end.


  1. Share us the entire Grid code snippet along with mode class
  2. Please ensure that Isprimarkey is defined in the detail grid
  3. Please set the OnActionFailure event in the detail grid for when the 'Update' button is clicked and share the OnActionFailure event args if any errors occur.
  4. Share us the video demonstration of the issue with elaborately , it will more useful to us.
  5. If possible share us a simple issue reproduceable sample with duplicate data.


The above-requested details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible.


Regards,

Naveen Palanivel



MA Martin November 6, 2023 08:39 AM UTC

I think this is actually dues to changes in Dot Net from 6 onwards.  The EF generated classes (scaffolded form the database) included non nullable virtual fields representing linked tables.  These were null when doing update/inserts in detail records which therefore failed.


Adding the  SuppressImplicitRequiredAttributeForNonNullableReferenceTypes  option as below resolved the issue.


builder.Services.AddControllersWithViews(options=>options.SuppressImplicitRequiredAttributeForNonNullableReferenceTypes = true)

    .AddMicrosoftIdentityUI();



MS Monisha Saravanan Syncfusion Team November 7, 2023 12:00 PM UTC


Hi Martin,


Thanks for the update.


We are glad to hear that you have find out the cause and resolved the issue on your own. Kindly get back to us if you need further assistance. As always we will be happy to assist you.


Regards,

Monisha



Loader.
Up arrow icon