This is a migrated thread and some comments may be shown as answers.
When I clicked expand in Hierarchial Grid , the event of MasterGrid's OnNeedDataSource is fired but detailGrid is not expand
3 Answers 17 Views
This is a migrated thread and some comments may be shown as answers.
Cheng-Chang
Top achievements
Rank 1
Cheng-Chang asked on 27 Mar 2018, 09:46 AM

When I clicked expand button in Hierarchial Grid, only the event of MasterTableView's OnNeedDataSource event is fired but DetailTablesis not expand.

After that I got javascript error as follow:

Uncaught Error: Sys.WebForms.PageRequestManagerServerErrorException: 運算式中語法錯誤。
    at Function.Error$create [as create] (ScriptResource.axd?d=AfvFZH5yr9SFZO1uJIkxMNpyoCc9wNwM5tA7rEHIyT11kgJ5EkhPsEnUeQe2gORcoMk74AeuNrfWZk4A_j_7v5lioH7P8YDhj_y126_XtCoSPPNdre0pBH5g0aXaTJJzdo2SYuiCu7FqqqNIViB9M7L6OwjuBkcGg8R3slWkEDqT31jr0&t=2e2045e2:222)
    at Sys$WebForms$PageRequestManager$_createPageRequestManagerServerError [as _createPageRequestManagerServerError] (ScriptResource.axd?d=BtzRDy2CmDYUKa-SuQWd30NyzML3bPck27UBkLxHZlNcJHVeYeA95bRcApKHuXI97vaTH-l0DJz23dNFK7Npu-q_uLvjYEzlAeOLA8GXd5-c7zfzkWXjj_fMGwj7E4dpNw6jhFSeO2hP0vYeuy66i_uIiu4O5u29HZCZe92isT_W9MHp0&t=2e2045e2:360)
    at Sys$WebForms$PageRequestManager$_parseDelta [as _parseDelta] (ScriptResource.axd?d=BtzRDy2CmDYUKa-SuQWd30NyzML3bPck27UBkLxHZlNcJHVeYeA95bRcApKHuXI97vaTH-l0DJz23dNFK7Npu-q_uLvjYEzlAeOLA8GXd5-c7zfzkWXjj_fMGwj7E4dpNw6jhFSeO2hP0vYeuy66i_uIiu4O5u29HZCZe92isT_W9MHp0&t=2e2045e2:1111)
    at Sys$WebForms$PageRequestManager$_onFormSubmitCompleted [as _onFormSubmitCompleted] (ScriptResource.axd?d=BtzRDy2CmDYUKa-SuQWd30NyzML3bPck27UBkLxHZlNcJHVeYeA95bRcApKHuXI97vaTH-l0DJz23dNFK7Npu-q_uLvjYEzlAeOLA8GXd5-c7zfzkWXjj_fMGwj7E4dpNw6jhFSeO2hP0vYeuy66i_uIiu4O5u29HZCZe92isT_W9MHp0&t=2e2045e2:903)
    at Array.<anonymous> (ScriptResource.axd?d=AfvFZH5yr9SFZO1uJIkxMNpyoCc9wNwM5tA7rEHIyT11kgJ5EkhPsEnUeQe2gORcoMk74AeuNrfWZk4A_j_7v5lioH7P8YDhj_y126_XtCoSPPNdre0pBH5g0aXaTJJzdo2SYuiCu7FqqqNIViB9M7L6OwjuBkcGg8R3slWkEDqT31jr0&t=2e2045e2:47)
    at ScriptResource.axd?d=AfvFZH5yr9SFZO1uJIkxMNpyoCc9wNwM5tA7rEHIyT11kgJ5EkhPsEnUeQe2gORcoMk74AeuNrfWZk4A_j_7v5lioH7P8YDhj_y126_XtCoSPPNdre0pBH5g0aXaTJJzdo2SYuiCu7FqqqNIViB9M7L6OwjuBkcGg8R3slWkEDqT31jr0&t=2e2045e2:2399
    at Sys$Net$WebRequest$completed [as completed] (ScriptResource.axd?d=AfvFZH5yr9SFZO1uJIkxMNpyoCc9wNwM5tA7rEHIyT11kgJ5EkhPsEnUeQe2gORcoMk74AeuNrfWZk4A_j_7v5lioH7P8YDhj_y126_XtCoSPPNdre0pBH5g0aXaTJJzdo2SYuiCu7FqqqNIViB9M7L6OwjuBkcGg8R3slWkEDqT31jr0&t=2e2045e2:5103)
    at XMLHttpRequest.Sys$Net$XMLHttpExecutor._onReadyStateChange (ScriptResource.axd?d=AfvFZH5yr9SFZO1uJIkxMNpyoCc9wNwM5tA7rEHIyT11kgJ5EkhPsEnUeQe2gORcoMk74AeuNrfWZk4A_j_7v5lioH7P8YDhj_y126_XtCoSPPNdre0pBH5g0aXaTJJzdo2SYuiCu7FqqqNIViB9M7L6OwjuBkcGg8R3slWkEDqT31jr0&t=2e2045e2:4721)

html is here:

<td class="rgExpandCol"><button type="button" name="ctl00$cphMain$RadGrid1$ctl00$ctl04$GECBtnExpandColumn" value="Expand" onclick="javascript:__doPostBack('ctl00$cphMain$RadGrid1$ctl00$ctl04$GECBtnExpandColumn','')" id="ctl00_cphMain_RadGrid1_ctl00_ctl04_GECBtnExpandColumn" title="Expand" class="t-button rgActionButton rgExpand"><span class="t-font-icon rgIcon rgExpandIcon"></span></button></td>

C#

<p></p><p><telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" GridLines="Both" runat="server"<br>    OnItemCommand="RadGrid1_ItemCommand" <br>    OnItemDataBound="RadGrid1_ItemDataBound" <br>    OnDetailTableDataBind="RadGrid1_OnDetailTableDataBind" <br>    OnNeedDataSource="RadGrid1_NeedDataSource" <br>    AutoGenerateColumns="False" <br>    AllowPaging="false"<br>    MasterTableView-HierarchyDefaultExpanded="false"><br>    <MasterTableView <br>        CommandItemDisplay="TopAndBottom" <br>        DataKeyNames="mrno,itemno"<br>        HorizontalAlign="NotSet" <br>        EditMode="Batch" <br>        AutoGenerateColumns="False"><br>        <CommandItemTemplate><br>            <telerik:RadPushButton runat="server" ID="SaveChangesButton" Text="儲存" CommandName="UpdateAll"><br>                <Icon CssClass="rgSaveIcon" /><br>            </telerik:RadPushButton><br>            <telerik:RadLinkButton runat="server" ID="RadLinkButton2" Text="回上一頁" NavigateUrl="SW_INV_K11_03.ASPX?ReQuery=1" /><br>        </CommandItemTemplate><br>        <BatchEditingSettings EditType="Cell" SaveAllHierarchyLevels="true" /><br>        <DetailTables><br>            <telerik:GridTableView DataKeyNames="mrno,itemno" <br>                AllowPaging="false" <br>                CommandItemDisplay="Top"<br>                EditMode="Batch" <br>                Name="Details"<br>                Width="100%" runat="server" ><br>                <ParentTableRelation><br>                    <telerik:GridRelationFields MasterKeyField="mrno,itemno" DetailKeyField="mrno,itemno"></telerik:GridRelationFields><br>                </ParentTableRelation><br>                <Columns><br>                    <telerik:GridButtonColumn ConfirmText="確定要刪除嗎?"<br>                        CommandName="Delete" Text="刪除" UniqueName="DeleteColumn1"><br>                        <HeaderStyle Width="20px"></HeaderStyle><br>                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle><br>                    </telerik:GridButtonColumn><br><br>                    <telerik:GridBoundColumn SortExpression="batch_no" HeaderText="批號"<br>                        DataField="batch_no" UniqueName="batch_no"><br>                    </telerik:GridBoundColumn><br><br>                    <telerik:GridTemplateColumn HeaderText="效期" UniqueName="valid_dt" HeaderStyle-Width="8%"><br>                        <ItemTemplate><br>                            <telerik:RadDatePicker RenderMode="Lightweight" ID="valid_dt_RadDatePicker" Width="50%" ClientEvents-OnDateSelected="OnDateSelected" runat="server"><br>                            </telerik:RadDatePicker><br>                        </ItemTemplate><br>                    </telerik:GridTemplateColumn><br>                    <telerik:GridBoundColumn SortExpression="valid_qty" HeaderText="數量" DataType="System.UInt32"<br>                        DataField="valid_qty" UniqueName="valid_qty"><br>                    </telerik:GridBoundColumn><br>                </Columns><br><br>            </telerik:GridTableView><br>        </DetailTables><br>        <Columns><br>            <telerik:GridBoundColumn DataField="mrno" HeaderText="補貨單編號" HeaderStyle-Width="8%"<br>                ReadOnly="True" SortExpression="mrno" UniqueName="mrno"><br>            </telerik:GridBoundColumn><br>            <telerik:GridBoundColumn DataField="itemno" HeaderText="材料編號" HeaderStyle-Width="10%"<br>                ReadOnly="True" SortExpression="itemno" UniqueName="itemno"><br>            </telerik:GridBoundColumn><br>            <telerik:GridBoundColumn DataField="item_nm" HeaderText="品名規格" HeaderStyle-Width="30%"<br>                HeaderStyle-HorizontalAlign="Center" ReadOnly="True" SortExpression="item_nm" UniqueName="item_nm"><br>            </telerik:GridBoundColumn><br>            <telerik:GridBoundColumn DataField="min_unit" HeaderText="單位" HeaderStyle-Width="6%"<br>                ReadOnly="True" SortExpression="min_unit" UniqueName="min_unit"><br>            </telerik:GridBoundColumn><br>            <telerik:GridBoundColumn DataField="real_qty" HeaderText="補貨數量" HeaderStyle-Width="8%"<br>                ReadOnly="True" SortExpression="real_qty" UniqueName="real_qty" ItemStyle-HorizontalAlign="Center"><br>            </telerik:GridBoundColumn><br>        </Columns><br>    </MasterTableView><br>    <ClientSettings AllowKeyboardNavigation="true"></ClientSettings><br></telerik:RadGrid></p>

3 Answers, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 30 Mar 2018, 08:37 AM
Hi Cheng-Chang,

The JavaScript error indicates that there might be a server error and is hidden by AJAX. To learn more about it and eventually find the underlying issue, please follow the instructions from the Get more descriptive errors by disabling AJAX article.

You can also check out the basic sample I've attached which fires the DetailTableDataBind event every time a row expands.

I hope this will prove helpful.

Kind regards,
Attila Antal
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Cheng-Chang
Top achievements
Rank 1
answered on 02 Apr 2018, 08:42 AM

I tried to set EnableAJAX="false" but I can't find any other new error message.
My Asp.net's structure is MasterPage+ContentPage and RadScriptManager is written in MasterPage as pic

.
I load master grid successfully. If I click expand and there is no record in detail gird's datasource, error didn't occur, but if there are records, an Uncaught Error: Sys.WebForms.PageRequestManagerServerErrorException: 運算式中語法錯誤 occured.

Sys.Res={
"argumentInteger":"值必須是整數。","scriptLoadMultipleCallbacks":"指令碼 \u0027{0}\u0027 包含多個 Sys.Application.notifyScriptLoaded() 的呼叫。只允許有一個。","invokeCalledTwice":"無法呼叫 Invoke 一次以上。","webServiceFailed":"伺服器方法 \u0027{0}\u0027 失敗,發生下列錯誤: {1}","webServiceInvalidJsonWrapper":"伺服器方法 \u0027{0}\u0027 傳回了無效的資料。JSON 包裝函式遺漏 \u0027d\u0027 屬性。","argumentType":"物件無法轉換為要求的型別。","argumentNull":"值不能為 null。","controlCantSetId":"ID 屬性不可在控制項上設定。","formatBadFormatSpecifier":"格式規範無效。","webServiceFailedNoMsg":"伺服器方法 \u0027{0}\u0027 失敗。","argumentDomElement":"值必須是 DOM 項目。","invalidExecutorType":"無法從下列建立有效的 Sys.Net.WebRequestExecutor: {0}。","cannotCallBeforeResponse":"responseAvailable 為 false 時無法呼叫 {0}。","actualValue":"實際的值為 {0}。","enumInvalidValue":"\u0027{0}\u0027 不是列舉 {1} 的有效值。","scriptLoadFailed":"無法載入指令碼 \u0027{0}\u0027。","parameterCount":"參數數目不符。","cannotDeserializeEmptyString":"無法還原序列化空字串。","formatInvalidString":"輸入字串格式不正確。","invalidTimeout":"值必須大於或等於零。","cannotAbortBeforeStart":"無法在執行程式啟動後中止。","argument":"值未落在預期的範圍內。","cannotDeserializeInvalidJson":"無法還原序列化。資料未對應到有效的 JSON。","invalidHttpVerb":"httpVerb 不可設定為空字串或 null 字串。","nullWebRequest":"不可以 null webRequest 呼叫 executeRequest。","eventHandlerInvalid":"未透過 Sys.UI.DomEvent.addHandler 方法加入處理常式。","cannotSerializeNonFiniteNumbers":"無法序列化非有限數目。","argumentUndefined":"值無法移除定義。","webServiceInvalidReturnType":"伺服器方法 \u0027{0}\u0027 傳回了無效的型別。必須是型別: {1}","servicePathNotSet":"此 Web 服務的路徑尚未設定。","argumentTypeWithTypes":"型別 \u0027{0}\u0027 的物件無法轉換成型別 \u0027{1}\u0027。","cannotCallOnceStarted":"無法在啟動後呼叫 {0}。","badBaseUrl1":"基礎 URL 未包含://。","badBaseUrl2":"基礎 URL 未包含其他 /。","badBaseUrl3":"基礎 URL 中找不到最後一個 /。","setExecutorAfterActive":"無法在執行程式變成使用中狀態後設定它。","paramName":"參數名稱: {0}","cannotCallOutsideHandler":"無法在已完成的事件處理常式之外呼叫 {0}。","cannotSerializeObjectWithCycle":"無法序列化子屬性內有循環參考的物件。","format":"辨識項目的其中之一使用無效的格式。","assertFailedCaller":"判斷提示失敗: {0}\r\n位於 {1}","argumentOutOfRange":"指定的引數超出有效值的範圍。","webServiceTimedOut":"伺服器方法 \u0027{0}\u0027 逾時。","notImplemented":"方法或作業尚未實作。","assertFailed":"判斷提示失敗: {0}","invalidOperation":"由於該物件目前的狀態,導致作業無效。","breakIntoDebugger":"{0}\r\n\r\n返回偵錯工具?"};

Type.registerNamespace('Sys.WebForms');Sys.WebForms.Res={
"PRM_UnknownToken":"未知的語彙基元: \u0027{0}\u0027.","PRM_MissingPanel":"找不到 ID 為 \u0027{0}\u0027 的 UpdatePanel。如果它正在動態更新,那麼它必須在另一個 UpdatePanel 內。","PRM_ServerError":"處理伺服器上的要求時發生未知的錯誤。從伺服器傳回的狀態碼為: {0}","PRM_ParserError":"無法剖析從伺服器收到的訊息。這項錯誤通常的原因是回應被 Response.Write()、回應篩選條件、HttpModules 的呼叫修改了,或是已啟用伺服器追蹤。\r\n詳細資料: {0}","PRM_TimeoutError":"伺服器要求逾時。","PRM_ParserErrorDetails":"剖析 near \u0027{0}\u0027 時發生錯誤。","PRM_CannotRegisterTwice":"PageRequestManager 不可初始化一次以上。"};

0
Attila Antal
Telerik team
answered on 05 Apr 2018, 06:59 AM
Hi Cheng-Chang,

According the error message, AJAX is still enabled on the page.

In order to provide you with a more accurate answer, we would require more information about the scenario. At this point I would advise you to Isolate the problem in a sample project and send it to us attached in a formal Support Ticket for further investigation. To save you some time, you can modify the sample page from my previous reply and attach it to the ticket.

Kind regards,
Attila Antal
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Cheng-Chang
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Cheng-Chang
Top achievements
Rank 1
Share this question
or