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

Export to PNG/PDF

2 Answers 41 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Joscha
Top achievements
Rank 2
Joscha asked on 08 Jan 2014, 03:27 PM
Hi,
i tried to export my RadGridView as PNG (followed this guide: http://www.telerik.com/help/wpf/common-export-support.html) works fine, but i want all the rows on the PNG-file. How do i do that? Adjust the grid.height right before the export?

I need a screenshot/image, word/excel is unfortunately not enough.

2 Answers, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 09 Jan 2014, 10:04 AM
Hello Joscha,

You would have to adjust the gridview height based on following snippet:
private void Button_Click(object sender, RoutedEventArgs e)
        {
            double originalHeight = this.RadGridView.Height;
            double newHeight = 0d;
 
            // You have to add 60px to the expression because this is the total height of the header row and group row
            newHeight = (this.RadGridView.RowHeight * this.RadGridView.Items.Count)+60;
 
            this.clubsGrid.Height = newHeight;
           // Begin Export logic
           ....
           // End Export logic
            this.clubsGrid.Height = originalHeight;
        }

Regards,
Hristo
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Joscha
Top achievements
Rank 2
answered on 10 Jan 2014, 08:55 AM
Hi Hristo,
your solution works for me, thanks!

Regards,
Joscha
Tags
GridView
Asked by
Joscha
Top achievements
Rank 2
Answers by
Hristo
Telerik team
Joscha
Top achievements
Rank 2
Share this question
or