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
215
analyzing clipboard contents before using .paste functinalityi in WebGrid...
posted

Hello all,

Is there a way that the WebGrid will allow you to programatically look at the clipboard contents prior to calling WebGrid.paste()?

The functionality I'm trying to accomplish here is to add more rows and/or columns to an existing grid in order to compensate for sizing correctly from data copied from an Excel spreadsheet...

For example, I have a grid that is 6 rows by 6 columns, and if I paste in data copied from Excel with more rows or columns, the grid ignores the additional columns.

So what I would like to do is to determine the rows and/or columns I need to add to the WebGrid (this should be doable on the client side?) by taking a look at the content on my clipboard (again, on the client side), and correctly resizing the WebGrid before the data is pasted.

I know about the BeforeClipboardOperation, I just need to get at the clipboard data! I'm using IE, so I have snooped around and there appears to be a way to grab clipboard data via javascript from IE, but I was wondering if there is some feature I don't know about in the WebGrid that will allow me to do this.

Thanks so much!

Mike