We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to copy complete DataGrid as image to clipboard

Thread ID:





145892 Jul 12,2019 07:22 AM UTC Jul 15,2019 10:25 AM UTC WPF 1
Tags: GridDataControl
magesh kumar
Asked On July 12, 2019 07:22 AM UTC


I have a Syncfusion GridDataControl in my window and a button to copy the contents of the table to clipboard. xaml is given below for reference.

<RowDefinition Height="30"/>
<RowDefinition Height="*"/>

<Button Content="Copy to Clipboard" Height="25" Width="150" Click="CopyDatagrid1" HorizontalAlignment="Right"/>

<syncfusion:LayoutControl SkinPickerVisibility="Collapsed" TraceVisibility="Hidden" 
  UserOptionsVisibility="Hidden" Grid.Row="1" VisualStyle="SyncfusionTheme">

<syncfusion:GridDataControl x:Name="dataGrid1" AllowResizeRows="False"
AutoPopulateColumns="False" AutoPopulateRelations="False" ShowAddNewRow="False" ItemsSource="{Binding DataGrid1Source}" 
VisualStyle="SyncfusionTheme" AllowEdit="False" AllowSort="False">
<syncfusion:GridDataVisibleColumn MappingName="Column1" HeaderText="Column1" AutoFit="True"/>
<syncfusion:GridDataVisibleColumn MappingName="Column2" HeaderText="Column2" AutoFit="True"/>
<syncfusion:GridDataVisibleColumn MappingName="Column3" HeaderText="Column3" AutoFit="True"/>
<syncfusion:GridDataVisibleColumn MappingName="Column4" HeaderText="Column4" AutoFit="True"/>

I wanted to check if there is an option to copy the entire contents of the table including headers, formatting etc to clipboard and then paste it to image format.
Basically this table which I'm trying to put should be copied as image when the button is pressed.

Kindly advice on how to achieve this.


Farjana Parveen Ayubb [Syncfusion]
Replied On July 15, 2019 10:25 AM UTC

Hi Magesh, 
Thank you for using Syncfusion controls. 
We have analyzed your query, we don’t have a direct support for copy the GridDataControl as an image in clipboard. So we have prepared a workaround for achieve your requirement by convert and copy the visible part of the GridDataControl to an image using RenderTargetBitmap class.   
Please refer the following link for sample, 
Please contact us for further assistance. 
Farjana Parveen A 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon