Ticket T130143
Visible to All Users

How to obtain the text of selected rows and copy it to the clipboard

created 11 years ago

[DevExpress Support Team: this thread was cloned from A332: How to obtain the text of selected rows and copy it to the clipboard]
As an alternative to GridView.GetSelectedCells, is it possible to use SendKeys.Send("^©") to quickly copy a cell selection to the clipboard, in exactly the same way as pressing ctrl+c does on a gridview? I tried this but couldn't get it to work so just not sure if I was doing something wrong.
Thanks

Answers approved by DevExpress Support

created 11 years ago

Hello Tristan,
I suggest you use the GridView.CopyToClipboard method instead of SendKeys.Send("^©") and GetSelectedValues. I'll update the article soon.
It seems that you can use SendKeys.Send("^©") . Note that c in the SendKeys.Send method should be in the lower case.
I've modified the How to copy selected rows to the clipboard example that illustrates the approach described in the How to obtain the text of selected rows and copy it to the clipboard KB article. Try the attached sample and let me know if this it works properly for you.

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.