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

Using Response.BinaryWrite when click on a button in Detail Grid

4 Answers 181 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Phuc
Top achievements
Rank 1
Phuc asked on 22 Aug 2011, 04:42 AM
Hi all,

I got a problem with AJAX when interacting with a control to use Response.BinaryWrite method as below :
- I have a Grid which has a detail area (this area contains detail information which includes a button), when this detail area is shown, user can click on a button to export a file by calling Response.BinaryWrite. My problem here is the radGrid in a RadAjaxPanel to use AJAX technique to show/hide detail area.

Is there any way to use export data in this case ?

Thanks a lot for your help.
Phuc

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Aug 2011, 05:17 AM
Hello Phuc,

This happens because you have ajaxified your RadGrid. Check the following help documentation which explains more about this.
Export from Ajaxified Grid.

Thanks,
Princy.
0
Phuc
Top achievements
Rank 1
answered on 22 Aug 2011, 07:02 AM
Hi Princy,

I have used this code to register postback control in gridDetail_NeedDataSource event :
ImageButton iBtnSaveAttachedFile = nestedItem.FindControl("iBtnSaveAttachedFile") as ImageButton;
ScriptManager.GetCurrent(Page).RegisterPostBackControl(iBtnSaveAttachedFile);

But after clicking on this button, the bug still appears as the attached file.

Do you have any ideas?
Thank for your reply,
Phuc
0
Tsvetina
Telerik team
answered on 24 Aug 2011, 01:29 PM
Hi Phuc,

This kind of error occurs only during an AJAX request, in other words your code did not work correctly. I would advise you to try the client-side approach suggested in the same help article or to try registering the postback control on ItemCreated event of the grid.

All the best,
Tsvetina
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Phuc
Top achievements
Rank 1
answered on 25 Aug 2011, 11:58 AM
Thank your for your help

Tags
Grid
Asked by
Phuc
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Phuc
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or