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.
ADAdministrator Syncfusion Team June 23, 2003 09:11 AM
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.
ADAdministrator Syncfusion Team June 23, 2003 09:16 AM
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.