tags:

views:

79

answers:

1

I have a Listbox where all cells are editable.

While the user is typing text in the ActiveCell (Textfield) she may decide to paste text.

I would like to examine the paste-text and perform different paste operations depending on whether it is multiline or not.

Is there any way to create an EditPaste MenuHandler specifically for ListBox1.ActiveCell?

+2  A: 

You should be able to use the keyboard async command and intercept the paste command in the Listbox.CellKeyDown event. Then take a look at the clipboard object to see what text it has in it.

Kind of a kludge, but I can't think of any other way to do it since the ActiveCell handles cut/copy/paste on its own without intervention.

BKeeney Software
Better than nothing, thanks. It would be good to find something that catches all methods of pasting though.
Steve Garman
Well, the problem is that there's no direct way to overriding the activecell unless you physically put an editfield in the grid yourself and control the paste from it (but then you lose the advantages of using the built-in editor). I've not done that but I suppose it's possible. The layering of the TextField on top of the listbox might be problematic.If you switched to the StyledGrid from Einhugur and used the CDirectEdit subclass you'd have a bit more control over the process. It's been a while since I've used the CDirectEdit class so YMMV.
BKeeney Software