We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Copy() in GridStaticCellRenderer

Hi, I want to implement cut/copy/paste for all my editable cells. And Copy for my static cells. Why is the Copy() method in GridStaticCellRenderer not implemented. I can see the reason Cut and paste is not implemented. thanks, - Reddy

2 Replies

AD Administrator Syncfusion Team June 23, 2003 02:11 PM UTC

The Renderer.Copy method is only called if the selection is a single cell (or text within a single cell). For example, in GridTextBoxCellRenderer.Copy, there is code that checks to see if there is selected text in teh cell, and either copies the whole text in the cell or selected text in the cell if there is any. Now for a Static cell, there is not the case of having partially selected text in the cell, so only the whole text is copied. Thus, there is no special processing required (as is in the TextBox case to check if there is partially selected text). So, there is no need to have this override implemented as the default processing in GridModel.Copy will hanlde this case.


AD Administrator Syncfusion Team June 23, 2003 02:16 PM UTC

For a static cell there is no selected text. So, it can just fall back to the default grid Copy mechanism which just copies the formatted text of that cell onto the clipboard. So, instead of GridStaticCellRenderer.Copy handling the copy operation instead GridModel itsself will handle this. The CopyTextToBuffer will handle this. It is called from GridModelCutPatse.Copy() taking into account any ClipboardFlags that have been set. Stefan

Loader.
Up arrow icon