Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
55
Pasting Multiple Lines into CellMultiLine
posted

I have a grid with a Notes field where users typically copy and paste large chunks of text from an email.  I have set CellMultiLine to true to accommodate multiples lines from the clipboard.  The row's height is set to just large enough to display one line of text.  The rest of the text can be seen through the tool-tip.

Here's my problem...

The paste function advances the display position forward to the last character on the clipboard.  So, for example, if there's a carriage return at the end of an email, the user only sees a blank line and it seems as if nothing was actually copied. 

I think it makes more sense for the first line from the clipboard contents to stay visible and the rest of the text to be invisibly copied "beneath" the first line.  Is there a way to make this happen?

Thanks,

Brandon King

 

 

 

 

  • 469350
    Verified Answer
    Offline posted

    Hi Brandon,

    You can control the position of the cursor using the SelectionStart and SelectionLength properties on the grid.ActiveCell. But I don't know of any easy way to detect that a paste operation has just taken place on a cell. Maybe you could trap KeyDown and watch for CTRL+V, but this would not work in the case where the user pastes using a context menu - unless you replace the default context menu with your own and it's events.