C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Copy the content of the GridView control to a clipboard


Posted Date: 05 Mar 2007    Resource Type: Code Snippets    Category: Winforms DataGrid

Posted By: Balamurali Balaji       Member Level: Diamond
Rating:     Points: 10



To copy the selected rows and columns in a clipboard, the following code may be used. Note the content gets copied to the clipboard in to the tablular form.

								
dataGridView1.MultiSelect = true;
dataGridView1.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
dataGridView1.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect;
DataObject dob = dataGridView1.GetClipboardContent();
Clipboard.SetDataObject(dob, true);




Responses

Author: Kapil Dhawan    17 Jun 2008Member Level: Gold   Points : 2
Hello
Nice piece of code
Thanks for sharing your knowledge with us.
I hope to see more good code from your side
This code will help lots of guys
Thanks to you
Regards,
Kapil



Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Validate a column in DataGridView
Previous Resource: Programmatically scroll the DataGridView Control to a specific column
Return to Discussion Resource Index
Post New Resource
Category: Winforms DataGrid


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use