[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

Copy DataViewGrid contents to the Clipboard

I can programmatically select the contents of a Data View Grid by using the following command:

        DataViewGrid1.select

Is there a one- or two-line piece of code that can be used to paste the selection to the clipboard, i.e. it emulates a user pressing [Control][C].?
0
rlsokoloff
Asked:
rlsokoloff
  • 2
1 Solution
 
jppintoCommented:
Use the Me.DataGridView1.GetClipboardContent().
0
 
rlsokoloffAuthor Commented:
You mean......

     DataViewGrid1.Select
     Clipboard.SetDataObject(Me.DataViewGrid1.GetClipboardContent)

This works.  Thank you.
0
 
rlsokoloffAuthor Commented:
It works with a more complete answer below......

     Clipboard.SetDataObject(Me.DataViewGrid1.GetClipboardContent)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now