Topic: copytoclipboard

Hi Dmitry,
A bit of help, please.
I know I can copy ALL rows in a tablegrid to the clipboard by right-clicking and selecting Copy All - Shift+Ctrl+C.
To make it easier for users, I would like to automate all of this by clicking a button instead.  I have tried to do this using 'SelectAll' and then 'CopyToClipboard' but this only seem to work with 'edit' fields.  Or perhaps I'm doing something wrong.
If this can't be done using 'CopyToClipboard', is it possible to send 'right-click' followed by 'Shift+Ctrl+c' by script instead?
I hope I've explained this clearly enough and thanks for your help.
Regards,
Derek.

Post's attachments

Attachment icon rightclick.zip 335.92 kb, 422 downloads since 2018-09-13 

Re: copytoclipboard

Hello.


procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
  form1.tablegrid1.dbPopupMenu.Items[5].Click;
end;
Dmitry.

Re: copytoclipboard

Hi Dmitry,
Perfect - much more straightforward now for the user.
Thanks.
Derek.
.
(for general info' - depending on your set-up,  it might not always be form1.tablegrid1.dbpopupmenu.items[5].click.  For example, on my version, it's  form1.tablegrid1.dbpopupmenu.items[4].click)

Re: copytoclipboard

Please download latest beta version
https://www.dropbox.com/s/yagi074bd24ox … a.zip?dl=0


Another way

form1.tablegrid1.dbPopupMenu.Items.Find('Copy all').Click;
Dmitry.

Re: copytoclipboard

Is there a way to make a paste(all) in the table grid ? And  another question, can we multI select for copy?

Re: copytoclipboard

v_pozidis wrote:

Is there a way to make a paste(all) in the table grid ? And  another question, can we multI select for copy?

Please create a new topic and describe your questions in more details.

Dmitry.

Re: copytoclipboard

Hello Dmitry,
Thanks for the alternative way of choosing 'copy all' and the update.
Derek.