How to handle Mutiple Batch Edit in single button click

I have used syncfusion grid control for data entry purposes in Batch Mode.It works fine as per our requirement.I would like to know how to handle multiple Grid Batch Handler in single "Save" button click.Please check my below requirement and advise how to do this.

Parent:-

It has Order Header information which contains three textbox ,four combobox and two date control.

Child 1:-

It has Order Details information with Color Details which contains syncfusion grid control in Batch Mode.

Child 2:-

It has Order size information with Size Details (One color has multiple size Details) which contains syncfusion grid control in Batch Mode.


I would like to know how to save all three details in single save click button.



6 Replies

RS Renjith Singh Rajendran Syncfusion Team December 16, 2021 09:22 AM UTC

Hi KINS, 
 
Greetings from Syncfusion support. 
 
We suggest you to call the EndEditAsync method of Grid for the corresponding detail grids to programmatically save all the batch changes in different Grids in a single button click. We have prepared a sample based on this scenario, please download the sample from the link below, 
 
Please refer the codes below, 
 
 
<SfButton OnClick="SaveBatch">SaveBatch</SfButton> 
 
<SfGrid @ref="Grid1" DataSource="@Employees" Height="315px" Toolbar="@(new List<string>(){"Add","Delete","Update","Cancel"})"> 
    ... 
</SfGrid> 
 
<SfGrid @ref="Grid2" DataSource="@Orders" Toolbar="@(new List<string>(){"Add","Delete","Update","Cancel"})"> 
    ... 
</SfGrid> 
 
@code{ 
    SfGrid<EmployeeData> Grid1; 
    SfGrid<Order> Grid2; 
    public async Task SaveBatch() 
    { 
        await Grid1.EndEditAsync(); 
        await Grid2.EndEditAsync(); 
    } 
 
 
Please get back to us if you need further assistance. 
 
Regards, 
Renjith R 



KI KINS replied to Renjith Singh Rajendran December 16, 2021 09:38 AM UTC

Thanks for reply...


but I would like to know how to pass Parent,child1 and child 2 list datasource in saveBatch.


Note:-

Parent ID should be link to child1 ID and child1 ID link to child2 when adding new/updating new record in single click



KI KINS December 16, 2021 03:24 PM UTC

Please help....




VN Vignesh Natarajan Syncfusion Team December 17, 2021 08:38 AM UTC

Hi KINS,  
  
Thanks for the update.  
  
Query: “but I would like to know how to pass Parent,child1 and child 2 list datasource in saveBatch. Note:- Parent ID should be link to child1 ID and child1 ID link to child2 when adding new/updating new record in single click 
 
We have analyzed your query and we are quite unclear about your requirement. So kindly share the following details.  
 
  1. Do want to get the batch edited record details in all the Grid on a button click?
  2. Or do want get the current selected record details from parent to Child1 and Child 1 to Child2.
  3. Or do you want to pass the Parent Grid component’s ID to Child1 or selected record ID to corresponding child records?
  4. Share the pictorial representation of your requirement if possible.
  5. Do you want to render record in Hierarchical structure?
  6. Share more details about the requirement.
 
Above requested details will be very helpful for us to validate the reported query at our end and provide solution as early as possible. 
 
Regards, 
Vignesh Natarajan 



KI KINS December 17, 2021 09:32 AM UTC

Thanks for clarification 

I need second points

want get the current selected record details from parent to Child1 and Child 1 to Child2


Please help its my top most urgent 



RS Renjith Singh Rajendran Syncfusion Team December 20, 2021 11:59 AM UTC

Hi KINS, 
 
We suggest you to use the GetSelectedRecordsAsync method, to fetch the currently selected records from a particular grid. 
 
Or if you need to fetch the current edited batch changes in a particular Grid, then we suggest you to use the GetBatchChangesAsync method. Calling this method will fetch the current edited/added/deleted batch changes in a particular Grid. 
 
If we have misunderstood your requirement or if you are facing any difficulties in using the above suggested methods, then kindly get back to us with the following details to proceed further. 
 
  1. Are you using Hierarchy Grid structure? Like this Hierarchy Grid demo.
  2. Or are you using Master Details Grid structure? Like this Master Details demo.
  3. Do you want to fetch currently selected records or currently edited/added/deleted batch changes?
  4. Share a video demo explaining your scenario.
  5. Share your complete Grid rendering codes.
 
The provided information will help us analyze the problem, and provide you a solution as early as possible. 
 
Regards, 
Renjith R 


Loader.
Up arrow icon