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

how solve uncaught exception in rad grid

1 Answer 152 Views
Grid
This is a migrated thread and some comments may be shown as answers.
khaled jendi
Top achievements
Rank 1
khaled jendi asked on 05 Sep 2011, 02:49 PM
I got the bellow error (from firebug console), after I click refresh icon button and click export grid content icon to (csv or pdf in top right corenr).
and of course, there is no response to export and nothing is downloaded

this is the error:
uncaught exception: [Exception... "'Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.' when calling method: [nsIDOMEventListener::handleEvent]"  nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)"  location: "JS frame :: resource://firebug_rjs/net/spy.js :: callPageHandler :: line 796"  data: no]

Line 0


here is my code:

                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <ClientEvents OnRequestStart="onRequestStart" />
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="gvViolation">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gvViolation" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

     <script type="text/javascript">
         function onRequestStart(sender, args) {
             if (args.get_eventTarget().indexOf("ExportToPdfButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {
                 args.set_enableAjax(false);
             }
         }
    </script>








<telerik:RadGrid ID="gvViolation" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" AlternatingItemStyle-HorizontalAlign="Center" Visible="false"
                                            AllowSorting="True" AutoGenerateColumns="true" AutoGenerateDeleteColumn="false" AutoGenerateEditColumn="false" AutoGenerateHierarchy="false"
                                            AllowPaging="True" PageSize="5" runat="server" GridLines="None"
                                            OnNeedDataSource="gvViolation_NeedDataSource" Skin="Sunset">

                                                <ExportSettings HideStructureColumns="true" OpenInNewWindow="true" >
                                                     <Pdf Author="WheelTrack" Creator="WheelTrack" />
                                                 </ExportSettings>
                                                 <MasterTableView Width="100%" CommandItemDisplay="Top"    >

                                                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>

                                                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
                            



                                                    <EditFormSettings>
                                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                                                    </EditFormSettings>


                                                    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                                    <CommandItemSettings ShowExportToWordButton="false" ShowExportToExcelButton="false" ShowExportToPdfButton="true" ShowAddNewRecordButton="false"
                                                        ShowExportToCsvButton="true"    />
                                                </MasterTableView>

                                                <FilterMenu EnableImageSprites="False"></FilterMenu>

                                                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Sunset"></HeaderContextMenu>
                                                </telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 Sep 2011, 06:56 AM
Hello Khaled,

I tried the same scenario in this version 2011.2.712.35 and it worked as expected. I suppose it might be a version issue. So try upgrading to to the latest version with the help of the following documentation.
Updating RadControls for ASP.NET AJAX to another version or license.

Thanks,
Princy.
Tags
Grid
Asked by
khaled jendi
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or