How do I display data in a table and allow users to copy selected data?

Posted by cfouche on Stack Overflow See other posts from Stack Overflow or by cfouche
Published on 2010-03-08T10:06:12Z Indexed on 2010/03/08 10:21 UTC
Read the original article Hit count: 258

Filed under:
|
|
|

Hi

I have a long list of data that I want to display in table format to users. The data changes when the user performs certain actions in my app, but it is not directly editable. So the user can create a reasonably big table of data, but he can't change individual cells' values.

However, I do want the data to be copy-able. So I want it to be possible for the user to select some or all of the cells, and do a ctrl-C to copy the data to his clipboard, and then a ctrl-V to paste the data to an external text editor.

At the moment, I'm displaying the data in a ListView with a GridView and this works perfectly, except that GridView doesn't allow one to copy data.

What other options can I try? Ours is a WPF app, coding in c#.

© Stack Overflow or respective owner

Related posts about xaml

Related posts about c#