views:

1869

answers:

5

Hi everyone,

  1. Is there a way that I can select a bunch of rows or cells from a SilverLight DataGrid and Copy them for pasting into e.g. excel?

The DataGrid doesn't seem to have this functionality built in!

Thanks a lot

A: 

Silverlight uses a vector rendering system. The text is not the same as text in Notepad- it's being rendered as a vector image. You can't highlight text in Silverlight or Flash.

If you're writing the app, offer a "download Excel file" button that redirects to an Excel file generator.

Dave Swersky
Silverlight 3 adds a "FileSaveDialog" control that can be used for this functionality.
Jeff Wilcox
A: 

Will do, thanks Dave...

A: 

Are you looking to do this programmatically? If so, then you are out of luck with Silverlight 3. Silverlight 4 is supposed to add this functionality.

Kirk
A: 

Silverlight 4 is great, Ctrl-A a datagrid, copy and paste it into Excel.

You can even customize what gets copied using ClipboardContentBinding, which is quite useful if you are using a TemplateColumn.

Michael