Grid - Master Details

1.I have a Grid inside a Template Row, in this grid when I have a DateTime field defined it shows me / Date (#######) /, as I can show in the format "dd / MM / yyyy".



2.It is required that when an element is added to the master grid, for element it is possible to add elements for the detail grid.
It is also required to add a number of elements to the detail grid, say 3 elements, these elements are shown when the detail is expanded.


Tanks..

Attachment: WebSite_bd69b297.rar

2 Replies 1 reply marked as answer

PS Pon Selva Jeganathan Syncfusion Team May 8, 2021 04:16 PM UTC

Hi Hector,    
   
Thanks for contacting syncfusion forum.  
  

Query: I have a Grid inside a Template Row, in this grid when I have a DateTime field defined it shows me / Date (#######) /, as I can show in the format "dd / MM / yyyy"

We have already discussed the same in following knowledge base document.   
  
Please refer the below KB documentation :   
 
Query2: It is required that when an element is added to the master grid, for element it is possible to add elements for the detail grid.It is also required to add a number of elements to the detail grid, say 3 elements, these elements are shown when the detail is expanded. 
 
we are validating your query with high priority and will update you with further details on within two business day.   
 
Meanwhile, we will contact you if we require any additional information. 
 
Until then we value your patience.   
 
Regards,  
Pon selva   

 

 

  
 



PS Pon Selva Jeganathan Syncfusion Team May 11, 2021 04:29 PM UTC

Hi Hector,    
   
Thanks for your patience.  
  
Query: It is required that when an element is added to the master grid, for element it is possible to add elements for the detail grid.It is also required to add a number of elements to the detail grid, say 3 elements, these elements are shown when the detail is expanded. 
 
Based on your query, we understand you need to add the data on detail grids when added data on master grid. We achieved this by using DetailDataBound event with addRecord method and refreshContent method of the grid.  Using addRecord method you can add data dynamically to the grid. Please refer to the code snippet below,  
  
<ej:Grid ID="gridPublications" DataManagerID="FlatData" runat='server' AllowPaging="true" > 
                 
<ClientSideEvents DetailsDataBound="gridPubAuthors"  DetailsExpand="detailsExpand"  Databound="dataBound" ActionBegin="gridPublicationsBegin"/> 
…. 
</ej:Grid>       
</div> 
 
function gridPubAuthors(e) { 
.     .       . 
 
var proxy = e; 
setTimeout(() => { 
   
    var obj = proxy.detailsElement.find('.e-grid').ejGrid("instance"); //Grid instance 
    if (ids == filteredData) {  //check whether newly added data(ArticleID) and filtered data’s Article ID with same value 
 
        obj.addRecord({            
            PersonID: 66, 
            OfDate: new Date(), 
            PersonName: "test", 
            Country: "uk", 
            ArticleID: filteredData, 
            Ignore: false }); 
        obj.refreshContent(); 
    } 
 
},0); 
} 
</script> 
 
<script type="text/javascript"> 
//global variable declaration 
var ids; 
 
//master grid action begin event 
function gridPublicationsBegin(args) { 
 
if (args.requestType == "save") { 
// assign the newly added record primary key value in local variable 
ids = args.data.ArticleID; 
 
} 
}     
</asp:Content> 
 
 
 
Please refer to the below modify sample, 
 
Please refer to the below API documentation, 
 
Kindly get back to us for further assistance. 
 
Regards,  
Pon selva   

 


Marked as answer
To post a reply.
Loader.
Up arrow icon