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

[Solved] Exporting multiple UserControls (PDF)

1 Answer 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 19 Aug 2009, 09:06 AM
hello,

we use the RadGrid from RadControls for ASP.NET AJAX Q2 2009.
In our Application we have the following Scenario:

Several UserControls (ASCX) encapsulate one or more RadGrids, partially with hierachy and/or NestedViewTemplate.
We have several ASP.NET-Pages, which are dynamically generated:
the UserControls are added to the Page and the RadGrids are filled with Data.

The requirement is to export the "content" of the UserControls (the RadGrid(s)) to one PDF-File from a button (or something like that)
inside the ASP.NET-Page.
Our first idea:
Is it possible to add the UserControls with the RadGrids to an additional RadGrid (maybe in a NestedViewTemplate?), and then
exporting that RadGrid?

We have tried out the following solution:
http://www.telerik.com/community/forums/aspnet-ajax/grid/export-multiple-grids-to-same-excel-file.aspx
But that does not work for us, because we need to add UserControls with encapsulated RadGrids and there is no way for us to do that in a declarative way.

Kind regards

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 20 Aug 2009, 02:51 PM
Hi Thomas,

Indeed, adding the user control into additional grid is the right direction in order to achieve your goal. You can add the controls into the grid ItemTemplate and bind it to a dummy data with one record, for instance:

protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)  
{  
    RadGrid1.DataSource = new object[] { 1 };  

Give it a try and let me know if any issues/questions arise.

Sincerely yours,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Thomas
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or