Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » All grids have their own clipboard? Collapse All
Subject Author Date
Bart Kampers Aug 30, 2010 - 1:40 AM

I derived two different classes from CExtGridWnd. They both have __EGSA_COPY and __EGSA_PASTE enabled. When I copy data from one grid I cannot copy it to the other one. It seems like each grid has its onw clipboard.


Is this correct? How can I overrule this behaviour?


Thanks in advance.

Bart Kampers Aug 31, 2010 - 12:43 AM

I can copy to Notepad and Excel. I also can copy cells within one grid but I cannot copy cells from one grid to another.

For example:

- I copy two cells having the values 1 and 2
- I paste them into the same grid
=> this works ok, also paste to Notepad and Excel
- I then paste them into another grid
=> Nothing happens
- I now copy two cells from the other grid having values 3 and 4
- I paste them into the same grid
=> again works ok
- I paste into the first grid
=> The values 1 and 2 are pasted, the values I copied the first time
- I paste in the second grid
=> The values 3 and 4 are pasted
- I paste in Notepad or Excel
=> The values 3 and 4 are pasted

Bart Kampers Aug 31, 2010 - 2:07 AM

I found out that the problem was in my own code.



Technical Support Aug 30, 2010 - 5:25 AM

The CExtGridWnd control uses Windows clipboard. So the ::AfxOleInit() API should be invoked during your application startup. The copied data can be paste into: other CExtGridWnd control, Microsoft Excel, Open Office Calc, Microsoft Word, Open Office Word, any plain text editors like notepad.exe. If you cannot paste grid cells into notepad.exe, then the grid control failed to copy data into Windows clipboard. This typically happens if you forgot to invoke the ::AfxOleInit() API.