Professional UI Solutions
Site Map   /  Register
 
 

Forum

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 Tech Support » Grid copy&paste multiple rows Collapse All
Subject Author Date
Rado Manzela Sep 28, 2010 - 6:37 AM

Is it possible to expand number of rows in destination grid to fit all rows in clipboard when I copy more rows from one grid and paste at the end of another? I’m using default acceleration commands (m_dwSupportedAccelCommands = __EGSA_COPY|__EGSA_CUT|__EGSA_PASTE|__EGSA_SELECT_ALL;)

Thank you.

Technical Support Sep 28, 2010 - 11:32 AM

The CExtGridWnd control provides Excel style of clipboard operations. An abstract cell region of any complexity can be selected, copied and paste without inserting new rows and columns. You can override the CExtGridWnd::OnGbwAccelCommand() virtual method and detect when the dwEGSA parameter is set to __EGSA_PASTE and the pCmdUI parameter is set to NULL. This is the case when the method performs the grid cell pasting. Your method should insert required count of rows, set focus to the top/left cell of the new inserted row range of cells and invoke the parent method. Please take a look at the source code of the CExtGridWnd::OnGbwAccelCommand() method. The CExtGR2D _rangeSel object describes the region of cells to paste and the CExtGR2D::GetRangeBounds() method allows you to detect the number of rows to insert.