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

Changing content type in response after ButtonColumn click

2 Answers 100 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 22 Aug 2011, 01:13 PM
Hey Guys,
Got a small problem with my radGrid.
I'm using a pdf production component to produce pdf output from a byte stream.
I launch this method from a standard button click and the pdf is streamed to the browser.
However, when I attempt this from a Button column in my radGrid, the call errors with:

"Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this
are when the response is modified by calls to Response.Write(), response filters, HttpModules or server trace is enabled"

Which makes sense because I'm intercepting the response and setting content-type, adding headers and BinaryWriting the data.

So as this works just fine outside of the RadGrid, is there something I can do to make the request happy with with calling it from within? I really need to bind things from the current row to make the call.

Many thanks
Mark.

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Aug 2011, 01:28 PM
Hello Simon,

Check the following article which explains how to avoid getting a PageRequestManagerParserErrorException.Hope this helps.
Sys.WebForms.PageRequestManagerParserErrorException - what it is and how to avoid it

Thanks,
Princy.
0
Simon
Top achievements
Rank 1
answered on 23 Aug 2011, 03:10 AM
Thanks Princy, that explains a lot.
I now see what I need to do - but face another hurdle in that my Ajax is handled by an AjaxManagerProxy object in a UserControl.
The event I'm tapping into to turn off ChildrenAsTriggers therefore is in the hosting page above the control.
I can't seem to get hold of the ButtonColumn object to make it do a regular postback.
In fact, if I try making the whole usercontrol or the radGrid inside do a regular postback, it still tries to Ajax me.

So I'm guessing I'm going wrong further up somewhere.

protected void ramInvoiceList_AjaxSettingCreated(object sender, AjaxSettingCreatedEventArgs e)
    {
        if (e.Updated == InvoiceList.InvoiceGrid)
        {
            e.UpdatePanel.ChildrenAsTriggers = false;
        }
    }


<telerik:RadAjaxManager ID="ramInvoiceList" runat="server" DefaultLoadingPanelID="AjaxLoadingPanel"
OnAjaxRequest="ramInvoiceList_AjaxRequest" OnAjaxSettingCreated="ramInvoiceList_AjaxSettingCreated">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="ramInvoiceList">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="InvoiceList" UpdatePanelHeight="" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="InvoiceList">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="InvoiceList" UpdatePanelHeight="" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

Where InvoiceList is the UserControl, and InvoiceGrid is the radGrid contained within.

Anyone have an example of how to make a Button column in a radGrid, nested in a user control via AjaxManagerProxy, do a regular postback?

thanks
Tags
Grid
Asked by
Simon
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Simon
Top achievements
Rank 1
Share this question
or