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

[Solved] ExportToPdf in nested grid, ajax issues...

1 Answer 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 23 Apr 2009, 05:09 PM
I have a grid that hosts a user control containing another grid and a few other controls in a nestedtabletemplate.  This user control has a button that invokes the ExportToPdf() function of the grid within the user control.  It works fine when the parent grid is not using AJAX, but when the parent grid is AJAXified, it no longer works. 

I have the following code in the Page_Load function of the user control....

 

if (!IsPostBack)

 

{

 

PostBackOptions options = new PostBackOptions(this);

 

Page.ClientScript.GetPostBackEventReference(options);

PdfButton.Attributes.Add(

"onclick",

 

 

string.Format("realPostBack('{0}', ''); return false;", PdfButton.UniqueID));

 

}

This is based on the documentation, but it clears the grid I am attempting to export when it is clicked instead of doing an export..

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 24 Apr 2009, 03:22 PM
Hi Chris,

The exporting feature of the control work with regular postbacks only. The reason is the grid prepares additional information when performing export operation (available on postback). When the action is performed through asynchronous requests, this information can not be passed through the XMLHttpObject - that is why the communication between the browser and the server fails.

To bypass the limitation you can wire the OnRequestStart event of the ajax panel or ajax manager, determine whether the target control is ajaxified and explicitly disable its ajax mode to export with regular postback.

More information about export from ajaxified grid is available in the following articles:
Help topic
Code library

I hope this information helps.

Greetings,
Pavlina
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
Chris
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or