Hierarchical Grid In Batch Mode

Hi,

I need to use hierarchical grid for data entry purpose so i need parent grid in Batch Mode and Also Child grid in Batch Mode.

The Problem i am facing is while Adding New Row to parent in Batch Mode the child Grid is not appearing.The Child Grid id appearing only i saved the parent record 
but i need not to save the parent record.At same time i need Child Grid to be appear once i added new row to Parent Grid.

1 Reply

MP Manivannan Padmanaban Syncfusion Team November 29, 2017 07:06 AM UTC

Hi Tamil, 
 
Thanks for contacting Syncfusion support, 
 
We understood from your query, you are facing the issue with child grid appearance while adding the new row into the parent grid with batch edit mode.  
By default, the changes are maintained in the cache variable and it is not affected the Grid’s datasource while add/edit/delete with batch edit, the changes will be stored on the Grid’s datasource while perform the batchsave action and the child grid will be render based on the queryString field value in the dataSource which is the default behavior of grid control. 
So, we suggest you to manually call the batchSave method of Grid control while expand the newly added row by using details-expand event of Grid control which is used to achieve your requirement and please refer to the below code example, 
  
<div id="ControlRegion"> 
    <ej-grid id="FlatGrid" 
             allow-paging="true" details-expand="detailsExpand"> 
            <e-edit-settings allow-adding="true" allow-editing="true" allow-deleting="true" edit-mode="@(EditMode.Batch)"></e-edit-settings> 
                <e-column field="OrderID" is-primary-key="true" header-text="OrderID" text-align="Right" width="75"></e-column> 
                …… 
            </e-columns> 
        </ej-grid> 
</div> 
@section scripts{ 
    <script> 
        function detailsExpand(args) { 
            if (args.masterRow.hasClass("e-insertedrow")) { 
                this.batchSave(); 
            } 
         } 
</script> 
  
We have created the sample that can be downloadable from the below location,  
 
  
Regards, 
Manivannan Padmanaban. 
  


Loader.
Up arrow icon