We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Need only one active content in data grid list [Detailed Template].

I want to display the detailed template data grid with only one content expanded and others in collapsed state.
Please check the below link for reference:

Ebenezer Justin

1 Reply

PS Pavithra Subramaniyam Syncfusion Team April 30, 2019 08:36 AM UTC

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. 
expand() { 
    this.gridObj.element.addEventListener('click', (e)=>{ 
          if(parentsUntil(e.target as Element, 'e-detailrowexpand')) { 
            let row = parentsUntil(e.target as Element , 'e-row'); 
            let rowIndex = parseInt(row.getAttribute('aria-rowindex')); 
Sample                       https://stackblitz.com/edit/angular-detailtemplate-144292?file=app.component.ts 
Pavithra S. 

Live Chat Icon For mobile
Up arrow icon