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

[Solved] RadCombobox after Response.BinaryWrite

1 Answer 115 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Markus
Top achievements
Rank 2
Markus asked on 22 May 2008, 01:45 PM
Hello!

I have a page with multiple RadComboboxes on it. The Datasources of the comboboxes are set in the Page_Load event.

On the same page i have a button that downloads a pdf document.
After clicking this button the comboboxes do not open anymore.

the button triggers a post back and the following code is executed:
########################
byte[] export = //Code to generate pdfDocument
            Response.ContentType = "application/pdf";
            Response.AddHeader("Content-Disposition", "attachment; filename=test.pdf \"");
            Response.BinaryWrite(export);
            Response.Flush();
            Response.End();
########################

what is going wrong?

thanks in advance
Markus

1 Answer, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 22 May 2008, 04:36 PM
Hi Markus,

Please read our kb article - How to use RadToolBar dropdown button with file output.

This article is for RadToolBarButton, but the same approach can be used with RadComboBox.

Another way to workaround the problem is the following approach:
.
1.Add a script reference to the ScriptManager
    <asp:ScriptManager ID="ScriptManager1" runat="server">  
            <Scripts> 
                <asp:ScriptReference Path="InitScript.js" /> 
            </Scripts> 
        </asp:ScriptManager> 

2.Override setIsInPostBack method of RadComboBox in the following way:
InitScript.js
// Hook up Application event handlers.       
var app = Sys.Application;       
app.add_init(ApplicationInit);       
        
function ApplicationInit(sender) {       
Telerik.Web.UI.RadComboBox.prototype.setIsInPostBack = function(isInPostBack)    
{    
}    


Regards,
Rosi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
Markus
Top achievements
Rank 2
Answers by
Rosi
Telerik team
Share this question
or