I have a SharePoint 2013 Visual Web part which I'm using with a RadHtmlChart and a RadGrid. When the user clicks on a slice of the pie chart I've created, the RadGrid ought to populate with details about that slice. The actual AJAX call itself works as it is supposed to but the RadAjaxManager object appears to not be wrapping anything in UpdatePanels when it renders the HTML. As a result, I get this message:
SCRIPT5022: Sys.InvalidOperationException: Could not find UpdatePanel with ID <panel ID related to control I attempt to attach>. If it is being updated dynamically then it must be inside another UpdatePanel.
I removed the AjaxSettings part of the RadAjaxManager object entirely to make sure that the rest of the page was running OK and it was (of course, it didn't render anything but the method executed successfully). I tried pointing the AjaxUpdatedControl attribute ControlID at any number of things: the original RadGrid, an ASP Panel wrapped around the RadGrid, an empty panel elsewhere on the page, and a button I'd created to test the code behind. In each and every one of these cases, I received the message above. I also explicitly set the RadGrid's "Visible" property to "true", even though in the code behind the OnNeedDataSource event feeds it an empty set and I have a NoRecordsTemplate setting (so it should be visible on its own at all times anyway) but the issue persists.
Below is my ASP page:
SCRIPT5022: Sys.InvalidOperationException: Could not find UpdatePanel with ID <panel ID related to control I attempt to attach>. If it is being updated dynamically then it must be inside another UpdatePanel.
I removed the AjaxSettings part of the RadAjaxManager object entirely to make sure that the rest of the page was running OK and it was (of course, it didn't render anything but the method executed successfully). I tried pointing the AjaxUpdatedControl attribute ControlID at any number of things: the original RadGrid, an ASP Panel wrapped around the RadGrid, an empty panel elsewhere on the page, and a button I'd created to test the code behind. In each and every one of these cases, I received the message above. I also explicitly set the RadGrid's "Visible" property to "true", even though in the code behind the OnNeedDataSource event feeds it an empty set and I have a NoRecordsTemplate setting (so it should be visible on its own at all times anyway) but the issue persists.
Below is my ASP page:
01.
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2014.2.618.45, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>
02.
03.
<
div
id
=
"webpart"
>
04.
<
telerik:RadAjaxManager
runat
=
"server"
ID
=
"radAjaxManager1"
OnAjaxRequest
=
"radAjaxManager1_AjaxRequest"
>
05.
<
AjaxSettings
>
06.
<
telerik:AjaxSetting
AjaxControlID
=
"radAjaxManager1"
>
07.
<
UpdatedControls
>
08.
<
telerik:AjaxUpdatedControl
ControlID
=
"rgPhaseDetails"
></
telerik:AjaxUpdatedControl
>
09.
</
UpdatedControls
>
10.
</
telerik:AjaxSetting
>
11.
</
AjaxSettings
>
12.
</
telerik:RadAjaxManager
>
13.
14.
<
telerik:RadCodeBlock
ID
=
"codeBlock"
runat
=
"server"
>
15.
<
script
type
=
"text/javascript"
>
16.
function FillDealsRadGrid(sender, args) {
17.
var phase = args.get_category();
18.
$find("<%= radAjaxManager1.ClientID %>").ajaxRequest(phase);
19.
}
20.
21.
</
script
>
22.
</
telerik:RadCodeBlock
>
23.
24.
<
div
id
=
"chartpaneldiv"
>
25.
<
telerik:RadHtmlChart
runat
=
"server"
ID
=
"rhcDealsByPhase"
Width
=
"900"
Height
=
"500"
Transitions
=
"true"
OnClientSeriesClicked
=
"FillDealsRadGrid"
>
26.
<
Appearance
>
27.
<
FillStyle
BackgroundColor
=
"White"
/>
28.
</
Appearance
>
29.
<
ChartTitle
Text
=
"Deals By Phase"
>
30.
<
Appearance
Align
=
"Center"
BackgroundColor
=
"White"
Position
=
"Top"
></
Appearance
>
31.
</
ChartTitle
>
32.
<
Legend
>
33.
<
Appearance
BackgroundColor
=
"White"
Position
=
"Right"
Visible
=
"true"
></
Appearance
>
34.
</
Legend
>
35.
<
PlotArea
>
36.
<
Appearance
>
37.
<
FillStyle
BackgroundColor
=
"White"
/>
38.
</
Appearance
>
39.
</
PlotArea
>
40.
</
telerik:RadHtmlChart
>
41.
</
div
>
42.
43.
<
telerik:RadGrid
runat
=
"server"
ID
=
"rgPhaseDetails"
OnNeedDataSource
=
"rgPhaseDetails_NeedDataSource"
AutoGenerateColumns
=
"false"
EnableAjaxSkinRendering
=
"true"
Visible
=
"true"
Enabled
=
"true"
>
44.
<
MasterTableView
Visible
=
"true"
>
45.
<
NoRecordsTemplate
>
46.
<
asp:Label
runat
=
"server"
Text
=
"No records to display. Please click on a slice of the pie chart above to view this control."
></
asp:Label
>
47.
</
NoRecordsTemplate
>
48.
<
Columns
>
49.
<
telerik:GridHyperLinkColumn
HeaderText
=
"Deal Name"
DataTextField
=
"TextField"
DataNavigateUrlFields
=
"TextlURL"
DataNavigateUrlFormatString
=
"{0}"
></
telerik:GridHyperLinkColumn
>
50.
</
Columns
>
51.
</
MasterTableView
>
52.
</
telerik:RadGrid
>
53.
54.
<
telerik:RadAjaxLoadingPanel
runat
=
"server"
ID
=
"rlpLoadingPanel"
Height
=
"77px"
Width
=
"113px"
Skin
=
"Metro"
></
telerik:RadAjaxLoadingPanel
>
55.
</
div
>