How to programmatically call a block pasting.

SyntaxEditor for WPF Forum

Posted 6 years ago by Frederic Gregoire
Version: 3.2.28


I've been using the Syntax Editor for quite a while and just got a new task. The task in itself is to use the 'Control+V' (Copy) feature for block selection. The feature in itself is already present within the Syntax Editor and works perfectly.

So my question is, when I copy some cells from an Excel sheet, how could I reproduce the same feature in the Syntax Editor? 

At the moment it will post on different lines but not in the Block selected.

Thanks in advance

Comments (2)

Answer - Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA


There is a special "MSDEVColumnSelect" format we look for in the clipboard data.  If any data with that format is present, then we insert the pasted text as a block insert.  SyntaxEditor and Visual Studio (and some other editors) use that same special format flag. 

To get it working from Excel data, you'd need to somehow inject a value under that format into the clipboard data object before our code executes.  You might be able to try handling our SyntaxEditor.PasteDragDrop event and watch for PasteDragDropAction.Paste actions.  Then inject data with that format type into the e.DataStore.  I haven't tried it but that might work.

Actipro Software Support

Posted 6 years ago by Frederic Gregoire

The solution is exactly as you said.

Thanks for the advice!  :)

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.