Collapse expanded detail row in grid

Thanks to a previous thread I have implemented expanding a detail row in a grid using the row selected event:
(rowSelected)='rowSelect($event)'

rowSelect() {
this.grid.detailRowModule.expand(this.grid.getSelectedRowIndexes())
}

Now for the opposite situation, is there anyway to collapse an expanded row?


1 Reply

IR Isuriya Rajan Syncfusion Team February 12, 2018 05:58 AM UTC

Hi Chris,  
 
Thanks for contacting Syncfusion support,  

We can collapse the expanded row using the “collapse” method  .Here we have collapse the row, while deselecting the already selected row.  

Code example for your reference   

rowDeselect(){   
       this.grid.detailRowModule.collapse(this.grid.getSelectedRowIndexes())//collapse method will collapse expanded row   
    }   

Sample for your reference:  


Regards,  
Isuriya R  


Loader.
Up arrow icon