Master Detail Grid: Editing detail record updates ALL the records in the detail grid

Please see the attached files.  I have a master detail grid.  When I edit and save ONE record in the detail grid, ALL the records in the detail grid are set to the one record that was changed.

Before editing the first record (row) in the detail data grid:


After editing the first record (row) in the detail data grid:



Attachment: EmployeeOdataAdaptor_3556c17c.zip

4 Replies

RS Renjith Singh Rajendran Syncfusion Team September 27, 2021 11:25 AM UTC

Hi Scot, 

Greetings from Syncfusion support. 

We suspect that the problem might have occurred because of not having unique valued column as primary key column in the Detail Grid. Only based on the primary key value, the editing update actions will occur in Grid. So if you are having same value for all the rows in primary key column, then on updating a single row, will update all the available rows in DetailGrid. 

We suspect that any one of the columns(EmployeeId/TrainingId) in Detailgrid is not having unique values. So we suggest you ensure to check this scenario from your side.  

We are attaching a sample which we have prepared based on this scenario. Please download the sample from the link below, 
 
Kindly check this scenario based on above suggestion from your side, and if you are still facing difficulties kindly get back to us with a simple issue reproducing sample along with a video demo showing the replication of the problem to proceed further. 

Regards, 
Renjith R 



SW Scot Woodyard September 27, 2021 10:13 PM UTC

I tested your suggestion and it did not resolve the problem.  I've attached a simple issue reproducing sample and  a video demo showing the replication of the problem.



Attachment: ITSSMaster_Sample_7cb8c889.zip


VN Vignesh Natarajan Syncfusion Team September 28, 2021 06:05 AM UTC

Hi Scott,  
 
Thanks for sharing the details.  
 
Query: “'ve attached a simple issue reproducing sample and  a video demo showing the replication of the problem. 
 
We have analyzed the provided video demo and we found that once the record is edited, records gets inserted twice. (i.e.) all other records gets updated with current selected records. This is cause of the issue. Currently we are validating the reported issue at our end with provided sample and we will update you the further details by 30th September 2021.  
 
Till then we appreciate your patience.   
 
Regards, 
Vignesh Natarajan  
 



RS Renjith Singh Rajendran Syncfusion Team September 30, 2021 03:54 AM UTC

Hi Scot, 

As informed in our previous update, the edit action in grid will be handled only based on primary key. We could see that you have set [Key] attribute for both EmployeeId and TrainingId fields. As the field does not have unique values, the reported behavior occurred. 

We suggest you to remove the [Key] attribute in EmployeeID to overcome this reported problem.  

    public partial class EmployeeTraining 
    { 
        /// <summary> 
        /// Employee foreign key property 
        /// </summary>        [Key]
        public Guid EmployeeId { getset; } 
 
        /// <summary> 
        /// Training foreign key property 
        /// </summary> 
        [Key] 
        public Guid TrainingId { getset; } 
        ... 
    } 
 

We have also modified the sample for your convenience, please download the modified sample from the link below, 
 
Please get back to us if you need further assistance. 

Regards, 
Renjith R 


Loader.
Up arrow icon