Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Components & Controls
Grids
Winforms Grids
Multiselection and copy-paste
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="DavidT_macktool, post: 28360, member: 1044"] Ok, I have an Idea. I have some code I use to copy selected cells to the clipboard to be able to paste into Excel. [code] If e.KeyCode = Keys.F4 Then Dim strTemp As String 'string to be copied to the clipboard Dim row As Integer Dim col As C1.Win.C1TrueDBGrid.C1DataColumn Dim cols As Integer, rows As Integer If Me.PartGrid.SelectedRows.Count > 0 Then For Each row In Me.PartGrid.SelectedRows 'copy everything here For Each col In Me.PartGrid.SelectedCols strTemp = strTemp & col.CellText(row) & vbTab Next strTemp = strTemp & vbCrLf Next System.Windows.Forms.Clipboard.SetDataObject(strTemp, False) MessageBox.Show("Range of " & Me.PartGrid.SelectedCols.Count & " x " & PartGrid.SelectedRows.Count & " cells have been copied to the clipboard for Excel.") Else MessageBox.Show("Please select a range of cells") End If End If[/code] This was written for a 3rd party DataGrid (ComponentOne TrueDBGrid) but it might give you some ideas. Mainly build a string with the values then tear it apart to put it into the new grid. Hope that helps... [/QUOTE]
Insert quotes…
Verification
Post reply
Components & Controls
Grids
Winforms Grids
Multiselection and copy-paste
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom