obtain selected row from Grid datasource

Hello team
can you please help us find the grid row data of selected rows.

I tried following example but,
From the examples I see Query object has take method but 
I am not able to find `index()` method on Query object to obtain the selected rows out 

https://stackblitz.com/edit/angular-etcpu1-tew3nz?file=app.component.html,app.component.ts%3AL59,data.ts


Thanks

Mohit



1 Reply

RS Rajapandiyan Settu Syncfusion Team August 29, 2022 01:03 PM UTC

Hi Raj,


Thanks for contacting Syncfusion support.


Query: can you please help us find the grid row data of selected rows.

By executing the getSelectedRecords() method of Grid, you can get the selected records data.


getSelectedRecord: https://ej2.syncfusion.com/angular/documentation/api/grid/#getselectedrecords

 

[index.js]

  btnClick(args) {

    var selectedRecords = this.grid.getSelectedRecords();

    console.log(selectedRecords);

  }

 


Sample: https://stackblitz.com/edit/angular-etcpu1-3vvm7v?file=app.component.html,app.component.ts


Also, the rowSelected event will be triggered after the row gets selected.


rowSelected: https://ej2.syncfusion.com/angular/documentation/api/grid/#rowselected


Please get back to us if you need further assistance.

Regards,

Rajapandiyan S
If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.


Loader.
Up arrow icon