|
-
Jun 14th, 2013, 06:29 AM
#1
Thread Starter
Frenzied Member
Need help with Clipboard and copy to-from Excel
Hi!
I am trying to figure out how to send a List<Of Person> into the clipboard so I can paste the properties as text in excel.
Person is an object that has some basic properties such as FirstName, LastName, Age etc And when paste in excel I want the list to be represented as a number of rows.
Likewise, when I select some text data in excel, and then trigger a paste command in my windows app, I want the selected data to update the existing list of persons.
Basically there is a grid control that has a datasource of List<Of Person> and I want to update this list when "pasting" text data. The paste will be stupid as in there is no check as to data types, simply paste and replace text. Also if I get out of bounds in the list I will add new rows in my list. Finally I do a refresh of the data source and the pasted info is displayed.
I have tried to google for this, but can only find the very basic type of examples when dealing with clipboard. Not how to "serialize" text to objects.
What I need are two methods, one that take input of clipboard and existing List and output a list where clipboard and existing lists have been "merged". And another function that creates clipboard info from an existing list called "Selectedrows". For the sake of simplicity it is only possible in this first version to deal only with rows...
Anyone has ideas on how to handle conversion from List<Of Person> to Clipboard and back again? Maybe write a small example?
Thanks!
Henrik
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|