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

Details on select

Hello,

how can I achieve, that the row details are expanded/collapsed on row selection?

3 Replies

SA Saravanan Arunachalam Syncfusion Team July 6, 2017 10:00 AM UTC

Hi Carsten, 
Thanks for contacting Syncfusion’s support. 
We have achieved your requirement by using RowSelected event and expandCollapse method of Grid control. Please refer to the below code example and also refer to the below api reference link. 
<ej:Grid ID="FlatGrid" runat="server" AllowPaging="True"> 
       <ClientSideEvents RowSelected="onRowSelected" /> 
           . . . 
</ej:Grid> 
         <script type="text/javascript"> 
             function onRowSelected(args) { 
                 //Expand or collapse the detail row based on the state of detail row. 
                 var tr = $(args.row); 
                 //To expand the detail row 
                 this.expandCollapse(tr.find("td.e-detailrowcollapse")); 
                 //To collapse the detail row 
                 this.expandCollapse(tr.find("td.e-detailrowexpand")); 
             } 
         </script> 
 
Regards, 
Saravanan A. 



CW Carsten Wuttke July 6, 2017 10:06 AM UTC

Thx Saravana. Works like a charm.



SA Saravanan Arunachalam Syncfusion Team July 7, 2017 04:26 AM UTC

Hi Carsten,  
Thanks for your update.            
We are happy that the provided information helped you. 
Regards, 
Saravanan A. 


Loader.
Live Chat Icon For mobile
Up arrow icon