Selecting row of Grid with Row template

Hello,

is there a way to select a row in a grid where each row is generated with a row template? (I need to use rowSelected event with its args values.)
I've tried using attributes selection-type and allow-selection, but it doesn't help. 

Thanks in advance!

5 Replies

KM Kuralarasan Muthusamy Syncfusion Team July 13, 2018 10:16 AM UTC

Hi Petra, 

Thanks for contacting Syncfusion support. 

From your query we found that you have used rowTemplate in your project and you want to trigger the event while selecting the row. But ejGrid do not have support for row selection and event while using the rowTemplate. 

Regards, 
Kuralarasan M. 



DJ Deepak Jain May 14, 2020 01:08 PM UTC

Is These available now?


MP Manivannan Padmanaban Syncfusion Team May 15, 2020 07:28 AM UTC

Hi Deepak, 

Greetings from Syncfusion Support. 

As we said earlier, we don’t have the selection support while using rowTemplate. Using rowTemplate feature we can able to render the dynamic elements. So, its not feasible to select all the dynamic elements. 

Regards, 
Manivannan Padmanaban 



AM Amrutha June 22, 2020 01:38 PM UTC

Is it possible to achieve this via css styling?


MP Manivannan Padmanaban Syncfusion Team June 23, 2020 11:05 AM UTC

Hi Amrutha, 
 
Greetings from Syncfusion Support. 
 
As per your request we have achieved your requirement using css styling. Refer to the below code example, 
 
 <script type="text/javascript"> 
………………………. 
       
         $("#Grid").on("click"function (e) { // use your grid id 
               var selected = $('.e-table > tbody').eq(1).find('tr').hasClass('highlight'); 
               if (selected) { 
                 $('.e-table > tbody').eq(1).find('tr').removeClass('highlight'); // remove previously selected row. 
               } 
               $(e.target).closest('tr').addClass('highlight'); 
        }); 
 
       
    </script> 
 
    <style type="text/css" class="cssStyles"> 
       
      .highlight { background-colorlightgreen; } 
…………………. 
    </style> 
 
 
 
Note: Using rowTemplate feature we can able to render the dynamic elements. So, we need to handle the css styling based on the element rendering. 
 
Regards, 
Manivannan Padmanaban 


Loader.
Up arrow icon