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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:





144292 Apr 29,2019 12:32 PM UTC Apr 30,2019 08:36 AM UTC Angular - EJ 2 1
Tags: Grid
Asked On April 29, 2019 12:32 PM UTC

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

Pavithra Subramaniyam [Syncfusion]
Replied On 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. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon