Copy Past Issue in grid

Kindly Tell me how I will get copyContent of rows in gird to preform copy paste functionality it show me this error show in console of the below image.  

data.PNG


1 Reply

JC Joseph Christ Nithin Issack Syncfusion Team November 15, 2021 02:28 PM UTC

  Hi Zeeshan,

      Greetings from Syncfusion support.

      Based on your query, you are facing an error while calling the `copyContent` private method of the `ClipboardModule` in EJ2 Grid. This issue can be resolved by calling the `copyContent` method by the following method.

Please refer the code example:

clickHandler(argsClickEventArgs): void {
    if (this.grid.getSelectedRecords().length > 0) {
      let withHeaderboolean = false;
      if (args.item.id === 'customPaste') {
        var copyContent = (this.grid.clipboardModule as any).copyContent;
        console.log(copyContent);
      } else if (args.item.id === 'copyHeader') {
        withHeader = true;
      }
      this.grid.copy(withHeader);
    } else {
      this.alertDialog.show();
    }
  }


Samplehttps://stackblitz.com/edit/angular-p88jzj?file=app.component.ts


Please refer the sample and revert for more queries.


Regards,
Joseph I.

Loader.
Up arrow icon