Hi Ebenezer,
Thanks for contacting Syncfusion Support.
We have validated your query. You can achieve your requirement using expand() and collapseAll() method of the detailRowModule inside the created event of Grid component. Please find the below code snippet.
Please find the below code example, sample and documentation link for your reference.
[component.ts]
expand() {
this.gridObj.element.addEventListener('click', (e)=>{
if(parentsUntil(e.target as Element, 'e-detailrowexpand')) {
this.gridObj.detailRowModule.collapseAll();
let row = parentsUntil(e.target as Element , 'e-row');
let rowIndex = parseInt(row.getAttribute('aria-rowindex'));
this.gridObj.detailRowModule.expand(rowIndex);
}
});
} |
Regards,
Pavithra S.