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

How to retrieve the selected records in the Grid in Angular Grid

Hi, I am following this example - https://ej2.syncfusion.com/angular/demos/?_ga=2.133986510.1538252749.1576809616-867896921.1564449587#/material/grid/checkbox-selection

When a user checks a few records, how can I add the selected record attributes such as "orderId" to a list?

1 Reply

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team December 30, 2019 04:12 AM

Hi Jose,  
 
Greetings from Syncfusion.  
 
Using the getSelectedRecords method, you can retrieve the selected records and therefore, OrderID values will be retrieved. Refer to the following code example.  
 
    @ViewChild('grid', {static: true}) 
    public grid: GridComponent; 
 
    public onClick(): void { 
      console.log(this.grid.getSelectedRecords().map((e)=>e['OrderID'])); 
    } 
 
 
 
Regards,  
Seeni Sakthi Kumar S 


Loader.
Live Chat Icon For mobile
Up arrow icon