Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
20821 | Oct 26,2004 12:42 PM UTC | Oct 26,2004 04:10 PM UTC | WinForms | 7 |
![]() |
Tags: GridControl |
Private Sub gridControl1_ClipboardCopy(sender As Object, e As GridCutPasteEventArgs) Dim range As GridRangeInfo = e.RangeList.ActiveRange If Not range.IsEmpty Then range = range.ExpandRange(1, 1, Me.gridControl1.RowCount, Me.gridControl1.ColCount) Dim s As String = "" Dim data As GridData = Me.gridControl1.Data Dim row As Integer While row <= range.Bottom If Not Me.gridControl1.Rows.Hidden(row) Then Dim firstCol As Boolean = True Dim col As Integer While col <= range.Right If Not Me.gridControl1.Cols.Hidden(col) Then If Not firstCol Then s += ControlChars.Tab Else firstCol = False End If Dim style As New GridStyleInfo(data(row, col)) s += style.Text End If End While s += Environment.NewLine End If End While Clipboard.SetDataObject(s) e.Handled = True End If End Sub ''gridControl1_ClipboardCopy
For intRow = objRange.Top To objRange.Bottom If (Not objGrid.Rows.Hidden(intRow)) Then bolFirstCol = True For intCol = objRange.Left To objRange.Right If Not bolFirstCol Then strClipBoard += vbTab Else bolFirstCol = False End If Dim objStyleInfo As New GridStyleInfo(objData(intRow, intCol)) strClipBoard += objStyleInfo.Text Next '' add in a new line after each row strClipBoard += Environment.NewLine End If Next
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.