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 cell faster paste Collapse All
Subject Author Date
Offer Har Jan 17, 2010 - 10:52 PM

Hi,


We would like to have these two functionalities in our grid:


When a user paste text onto a cell, even if the cell is not in edit mode, the text will be pasted - currently we need to double click or F2 the cell and only then paste - this is slowinf the edit process down.


Is this feature avaialbe?


Thanks,


Ron.

Technical Support Jan 19, 2010 - 1:22 PM

Thank you for reporting us the unwanted assertion / crash issue with number cells. To fix it, please add the following method into the CExtGridCellNumberBase class:

   virtual void TextSetOnPaste(
                        __EXT_MFC_SAFE_LPCTSTR str = __EXT_MFC_SAFE_LPCTSTR(NULL), // empty text
                        bool bAllowChangeDataType = false
                        );

void CExtGridCellNumberBase::TextSetOnPaste(
            __EXT_MFC_SAFE_LPCTSTR str, // = __EXT_MFC_SAFE_LPCTSTR(NULL) // empty text
            bool bAllowChangeDataType // = false
            )
{
            __EXT_DEBUG_GRID_ASSERT_VALID( this );
            bAllowChangeDataType = false;
            CExtGridCellVariant::TextSetOnPaste( str, bAllowChangeDataType );
}

Technical Support Jan 19, 2010 - 1:22 PM

The CExtGridCell::TextSetOnPaste() and CExtGridWnd::OnGbwAccelCommand virtual methods can be overridden for catching the grid cell modifications when performing pasting from clipboard.

Offer Har Jan 18, 2010 - 9:09 PM

Thanks - it works great... however, I have one problem with that - We do some operations in OnGridCellInputComplete and in OnGridCellInplaceControlTextInputVerify, which are not called when we use these accelerated commands. what are the function called when a cell’s text is changed using the cut and paste accelerated commands?

Technical Support Jan 18, 2010 - 1:32 PM

Yes. The CExtGridWnd class supports clipboard operations and the copied/paste text is compatible both with text editors and Excel. You should specify appropriate __EGSA_*** flags in the CExtGridBaseWnd::m_dwSupportedAccelCommands property.

Offer Har Jan 18, 2010 - 9:34 PM

Dear Support,


I think that also the build-in cells do not handle this paste operation very well- If you try and paste a text into a CExtGridCellNumberBase derived cell, the application crashes in an assert.


I guess it’s because the cell expect numbers only, and when text it pasted, it (same as my cell...) did not know about it, and did not handle it correctly.


Is there any way to unify the OnGridCellInputComplete and  OnGridCellInplaceControlTextInputVerify, which are already there, with the cell paste & cut?


I’m sure this will save a lot of us a lot of time...


Thanks,


Ron.