Programmatically copy radgridview into clipboard

3 posts, 0 answers
  1. Jia
    Jia avatar
    3 posts
    Member since:
    Jan 2014

    Posted 04 Aug 2015 Link to this post

    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. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 05 Aug 2015 Link to this post

    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
  3. DevCraft banner
  4. Jia
    Jia avatar
    3 posts
    Member since:
    Jan 2014

    Posted 05 Aug 2015 in reply to Dimitrina Link to this post

    Thank you, problem solved.

     

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

Back to Top