PDA

View Full Version : New Grids: copying the content to clipboard?



Emil Preter
27-May-2010, 11:52 AM
Hi,

is it possible with the new grids to copy parts of the grid items or all to the clipboard?
I think it would be very nice.

Emil

phvwijk
27-May-2010, 12:27 PM
Hi,

That would be fairly easy to do I think.

All data is kept in an array (look at datasource)
You can add a right mouse click, copy to clipboard.
That calls up a process, taking the array data and put it in csv or something you want
Then use the vdf clipboard logic to get in the clipboard.

Selecting cells is something which is discussed before I think.

Peter

Emil Preter
28-May-2010, 04:35 AM
Hi,

you say: That calls up a process, taking the array data and put it in csv or something you want

I found in cCJStandardMenuItemClasses.pkg


Procedure OnExecute Variant vCommandBarControl
Send Copy of (focus(Self))
End_Procedure


but know I dont know how to take the array data and put it in csv or something else.

Copy always waits for an object that has the focus, but an array is not an object.

Any help?

Emil

phvwijk
28-May-2010, 07:11 AM
Hi,

You will have to write you own logic in a process to get the selected data from the grid into the clipboard.

Peter

chuckatkinson
29-May-2010, 09:22 AM
Hi,

is it possible with the new grids to copy parts of the grid items or all to the clipboard?
I think it would be very nice.

Emil

There is a Codejock procedure call ComCopy that does all this for you. You can even assign a FlexKey like Ctrl+C to send this message. It will copy all selected lines to the clipboard.

BTW, you can even paste back in to the grid, but this is a lot more complicated.

HTH

FrankValcarcel
9-May-2011, 01:54 PM
Hi Chuck,
I have been trying ComCopy and it does not seem to work.
fv

Vincent Oorsprong
10-May-2011, 12:53 AM
Frank,

I think it won't work because the data is not in the grid but in the datasource.

FrankValcarcel
10-May-2011, 07:29 AM
Not good, Copy and Paste are such basic windows functions that an application without them is embarrassing. The cjGrid object has the calls defined, they just don't work.
fv

Vincent Oorsprong
10-May-2011, 08:44 AM
Frank,

I have not looked into this but I expect it works fine when the cell is in edit mode. If the cell is not in edit mode you could access the datasource in the events triggered.

FrankValcarcel
10-May-2011, 08:49 AM
Yes, it works in Edit mode as we are using the DAC edit object. The issues are:

1: Copy/Paste in Row mode which just don't seem to work per doc. ComCopy does nothing.

2: The toolbar buttons are making the wrong calls as they are making the CJ calls (copy/paste) and the grid requires ComCopy and ComPaste.

John2E confirmed the toolbar issue and is recording as a bug.

ivansc
26-May-2011, 06:49 PM
Hi Frank,
I use the attached packages to copy data from clipboard to cjgrids.
First I used compaste, but with direct_input we have better control over the data.
Please check if they are usefull and be carefull with the DB version, I havenīt tested it very much.
Regards
Ivan Schoof