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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to share data from a selected row from a data grid to another

Thread ID:





141413 Dec 10,2018 07:08 PM UTC Dec 20,2018 09:07 AM UTC Angular - EJ 2 3
Tags: Grid
Asked On December 10, 2018 07:08 PM UTC

Hi team,

I need to pass data from a selected row on the syncfusion data grid to child component (I'm using Angular 7) and I'm wondring if syncfusion got it's own methods or do I just use @Input/@Output from angular? I hope you can share some examples if possbile.

Thavasianand Sankaranarayanan [Syncfusion]
Replied On December 11, 2018 04:56 AM UTC

Hi Ali, 

Thanks for contacting Syncfusion support. 

As per your given detail we suspect that you want to update the other Grid dataSource when we select a row in a Grid. 

We have already discuss about the above mention query in the following Online sample. 

Thavasianand S. 

Replied On December 19, 2018 08:01 PM UTC

Thanks team for your help.

I have another question and it's regarding rowSelecting() and rowSelected() in Angular 7, how I can use the both function inside  ngOnInit() ? as I have other functions that online work inside the lifecycle hook .


Madhu Sudhanan P [Syncfusion]
Replied On December 20, 2018 09:07 AM UTC

Hi Ali, 

Thanks for the update. 

The rowSelected and rowSelecting are event of the grid component which can be registered to the grid using () method in the component template.  

<ejs-grid . . .  (rowSelecting)="rowSelecting($event)"> 
    . . . .  

It is not possible to register them inside the ngOnInit event as the grid is not initialized. If you want to bind the event handlers programmatically then please use ngViewAfterInit hook to bind the event as follows. 

export class DefaultComponent implements OnInit { 
    public data: Object[] = []; 
    public grid: GridComponent; 
    ngAfterViewInit(): void { 
      this.grid.rowSelecting.subscribe((e) => console.log('rowSelecting')); 
      this.grid.rowSelected.subscribe((e) => console.log('rowSelected')); 

If we misunderstood your requirement then please provide more information regarding your requirement. 

Madhu Sudhanan P 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon