I am having an issue with using RadAjaxManager to rebind 2 RadGrids. Here is basically how my page is setup:
RadAjaxManager
RadMultiPage
RadPageView1
RadGrid1
RadPageView2
RadGrid2
What I want to happen is when closing a RadWindow I call a javascript function on the parent page and pass an argument to determine which RadGrid I want to rebind. This works fine when I am trying to update only 1 RadGrid and do not have the other RadGrid specified in the properties of the RadAjaxManager. I'm not sure if it doesn't work because I have setup the RadAjaxManager improperly or what, but I receive the following error every time I try to rebind a RadGrid via Javascript when closing a RadWindow.
Error: "Sys.InvalidOperationException: Could not find UpdatePanel with ID 'ctl00_ctl00_DefaultContentPlaceHolder_FMSContentPlaceHolder_ctl00_ctl00_
DefaultContentPlaceHolder_FMSContentPlaceHolder_rgOrdersReceivedPanel'.
If it is being updated dynamically then it must be inside another UpdatePanel."
Here is my code:
RadWindow Javascript to call refreshGrid function on parent page:
Parent Page Javascript:
Code Behind:
RadAjaxManager
RadMultiPage
RadPageView1
RadGrid1
RadPageView2
RadGrid2
What I want to happen is when closing a RadWindow I call a javascript function on the parent page and pass an argument to determine which RadGrid I want to rebind. This works fine when I am trying to update only 1 RadGrid and do not have the other RadGrid specified in the properties of the RadAjaxManager. I'm not sure if it doesn't work because I have setup the RadAjaxManager improperly or what, but I receive the following error every time I try to rebind a RadGrid via Javascript when closing a RadWindow.
Error: "Sys.InvalidOperationException: Could not find UpdatePanel with ID 'ctl00_ctl00_DefaultContentPlaceHolder_FMSContentPlaceHolder_ctl00_ctl00_
DefaultContentPlaceHolder_FMSContentPlaceHolder_rgOrdersReceivedPanel'.
If it is being updated dynamically then it must be inside another UpdatePanel."
Here is my code:
RadWindow Javascript to call refreshGrid function on parent page:
function
refreshGrid() {
var
oWindow = GetRadWindow();
oWindow.BrowserWindow.refreshGrid(
"Inventory"
);
oWindow.Close();
}
Parent Page Javascript:
function
refreshGrid(arg) {
if
(arg ==
"Rebind"
) {
$find(
"<%= RadAjaxManager1.ClientID %>"
).ajaxRequest(
"Rebind"
);
}
else
if
(arg ==
"Inventory"
) {
$find(
"<%= RadAjaxManager1.ClientID %>"
).ajaxRequest(
"Inventory"
);
}
}
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
OnAjaxRequest
=
"RadAjaxManager1_AjaxRequest"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadAjaxManager1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"rgInventory"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"rgOrdersReceived"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadWindowManager1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"rgInventory"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"odsInventory"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"odsInventoryReceived"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"rgInventory"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"destroyWin"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"rgInventory"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"rgOrdersReceived"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"rgOrdersReceived"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
Code Behind:
protected
void
RadAjaxManager1_AjaxRequest(
object
sender, AjaxRequestEventArgs e)
{
if
(e.Argument ==
"Rebind"
)
{
rgOrdersReceived.Rebind();
}
else
if
(e.Argument ==
"Inventory"
)
{
rgInventory.Rebind();
}
}