Author Topic: Get Cell Address Of copied Excel sheet Column  (Read 616 times)

Punit

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 46
    • View Profile
Get Cell Address Of copied Excel sheet Column
« on: May 21, 2022, 11:19:47 am »
Dear Team,
How to get address cell of excel sheet in columnTemplate event.

Thanks

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Get Cell Address Of copied Excel sheet Column
« Reply #1 on: May 23, 2022, 10:23:25 am »
columnTemplate is an object and not an event and it's not possible to get copied cell information.

You can get the content and address of cells affected by paste in beforePaste event though.

https://paramquery.com/pro/api#event-beforePaste

Punit

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Get Cell Address Of copied Excel sheet Column
« Reply #2 on: May 23, 2022, 03:00:46 pm »
We have two grids. We copy from grid one and paste it into the second grid. Now I want to get the address of grid one while copying. beforePaste event is not helpful for me in this case because I want to get the cell address of grid1. Is there any alternate way to achieve this?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Get Cell Address Of copied Excel sheet Column
« Reply #3 on: May 24, 2022, 11:03:58 am »
If the user copies cells from grid1 using a context menu or button, then you can save the address of copied cells by calling grid.Selection().address() just before calling copy method.

Code: [Select]
var S = grid1.Selection();
var address = S.address();//save the address of copied cells
S.copy();

Punit

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Get Cell Address Of copied Excel sheet Column
« Reply #4 on: May 25, 2022, 11:38:16 am »
Is there any event that executes before or after copy without any context menu or button click?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Get Cell Address Of copied Excel sheet Column
« Reply #5 on: May 26, 2022, 10:19:35 am »
There is no copy related event currently.

It would be added in upcoming version thanks for your feedback.