This is a migrated thread and some comments may be shown as answers.

CopyingCellClipboardContent

1 Answer 121 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Lorenzo
Top achievements
Rank 1
Lorenzo asked on 22 May 2017, 03:55 PM

Hello,

 

I am trying to copy only the selected cell content but having FullRow selection mode. So I wanted to use the CopyingCellClipboardContent event but it does not fire with the Control+C Key combination. Is this the expected behavior?

 

So I have to use the KeyDown event from Gridview as this:

    Private Sub grdMaquina_KeyDown(sender As Object, e As KeyEventArgs) Handles grdMaquina.KeyDown

        If e.KeyCode = Keys.C And e.Control Then
            If Not IsNothing(grdMaquina.CurrentCell) AndAlso Not IsNothing(grdMaquina.CurrentCell.Value) Then Clipboard.SetText(grdMaquina.CurrentCell.Value)
            e.Handled = True
        End If

    End Sub

Is this correct?

Thank you.

 

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 23 May 2017, 10:29 AM
Hello Lorenzo,

This is an issue which I have logged in our Feedback Portal. I have added a vote for it on your behalf as well. You can track its progress, subscribe for status changes and add your comment to it here. I have also updated your Telerik Points.

To workaround this you can use the Copying event:
Private Sub RadGridView1_Copying(ByVal sender As Object, ByVal e As GridViewClipboardEventArgs)
    e.Cancel = True
    If radGridView1.CurrentCell.Value IsNot Nothing Then
        e.DataObject.SetData(DataFormats.Text, False, radGridView1.CurrentCell.Value.ToString())
    End If
End Sub

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Lorenzo
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or