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

Programmatically copy radgridview into clipboard

2 Answers 468 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jia
Top achievements
Rank 1
Jia asked on 04 Aug 2015, 08:34 PM

Hi,

My scenario is like this,

I'm trying to do this in a button click event. Focus on the radgridview, select all rows. I know that I could do it by press ctrl+c to copy it. Can I somehow do it programmatically in the button click, so that i can make the button 'copy all' instead of 'select all'. It's kinda unnecessary. it's a customer requirement...

 

Private Sub btnDtlCopy_Click(sender As Object, e As RoutedEventArgs)
        gvCTPDtl.Focus()
        gvCTPDtl.SelectAll()
End Sub​

 

 Any idea is highly appreciated.

thank you

2 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 05 Aug 2015, 09:00 AM
Hi,

You can execute RadGridViewCommand. For more information, please check the documentation on Commands Overview.

Regards,
Dimitrina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jia
Top achievements
Rank 1
answered on 05 Aug 2015, 04:40 PM

Thank you, problem solved.

 

gvExportDtl.SelectAll()
Dim copyCommand = TryCast(RadGridViewCommands.Copy, RoutedUICommand)
copyCommand.Execute(Nothing, gvExportDtl)​

Tags
GridView
Asked by
Jia
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Jia
Top achievements
Rank 1
Share this question
or