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

Grid, OnCommand, RadWindow

8 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David Simmonds
Top achievements
Rank 1
David Simmonds asked on 05 Jun 2010, 11:54 PM
I handle the OnCommand client-side event for a Grid. I pull out the ID of the record of interest. Part of that record is a byte stream that contains the contents of a PDF file. The OnCommand handler calls radopen to display an aspx page:
            function RadGrid1_OnCommand(sender, eventArgs) {  
                var nID = sender.get_masterTableView().get_dataItems()[0].getDataKeyValue("ID");  
                var commandName = eventArgs.get_commandName();  
                if (commandName == "PDF") {  
                    var wnd = window.radopen("/ShowInvoicePDF.aspx?ID=" + nID, null);  
                    return false;  
                }  
            }  
 
The ShowInvoicePDF markup is just like the VS2010 wizard created it and I added nothing to it. I do this in the Page_Load method.
        protected void Page_Load(object sender, EventArgs e)  
        {  
            int nID = Convert.ToInt32(Request.QueryString["ID"]);  
            Invoice invoice = Invoice.FindByID(nID);  
 
            Response.Clear();  
            Response.ClearContent();  
            Response.ClearHeaders();  
            Response.Buffer = true;  
            Response.ContentType = "Application/pdf";  
            Response.AddHeader("Accept-Ranges""bytes");  
            Response.AddHeader("Accept-Header", invoice.PDFData.Length.ToString());  
            Response.AddHeader("Cache-Control""public");  
            Response.AddHeader("Cache-Control""must-revalidate");  
            Response.AddHeader("Pragma""public");  
            Response.AddHeader("expires""0");  
            //Response.BinaryWrite(invoice.PDFData);  
            Response.OutputStream.Write(invoice.PDFData, 0, invoice.PDFData.Length);  
            //Response.Flush();  
            //Response.Close();  
            Response.End();  
        }  
 
When the webapp is run using IE 8 under Windows 7, the radwindow comes up but all I see is the rotating RadAjaxLoadingPanel wheel. If I use FireFox it works fine. If I run the ShowInvoicePDF.aspx file directly from the IE browser, it works fine, so there must be some kind of interaction with javascript/ajax/radwindow happening. Why is this happening (an answer of "because you are using MS IE" is not a valid response)? What do I need to do to make it work on all browsers?

8 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 10 Jun 2010, 01:53 PM
Hello David,

Please try the following code:
if (commandName == "PDF")
{
    var wnd = window.radopen("/ShowInvoicePDF.aspx?ID=" + nID, null);
    eventArgs.set_cancel(true);
...

Let me know whether this helps.

Regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
David Simmonds
Top achievements
Rank 1
answered on 10 Jun 2010, 02:26 PM
That did not work. It still goes into wait mode spinning the wheel and never returns. I also tried putting return false; after the set_cancel line with no change in behaviour.
0
David Simmonds
Top achievements
Rank 1
answered on 14 Jun 2010, 07:40 PM
Do you have any other ideas?
0
Daniel
Telerik team
answered on 16 Jun 2010, 12:02 PM
Hello David,

Can you isolate the problem in a simple, runnable demo? I will debug it on my end and then provide more to-the-point suggestion.

Kind regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
David Simmonds
Top achievements
Rank 1
answered on 16 Jun 2010, 03:29 PM
The system would not let me attach a .zip file with the project. How can I send the sample project to you?
0
Daniel
Telerik team
answered on 17 Jun 2010, 09:37 PM
Hello David,

You could attach the demo to a support ticket:
New Support ticket

Please provide a reference (link) to this forum thread.

Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
David Simmonds
Top achievements
Rank 1
answered on 17 Jun 2010, 10:36 PM
A support ticket has been added.
0
Daniel
Telerik team
answered on 23 Jun 2010, 12:00 PM
Hello David,

Thank you for taking the time to provide a runnable project. The problem is that due to browser limitations (in IE) you should always set ShowContentDuringLoad="true" in such scenarios.

Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
David Simmonds
Top achievements
Rank 1
Answers by
Daniel
Telerik team
David Simmonds
Top achievements
Rank 1
Share this question
or