I know this has come up multiple times and I have read multiple posts but have not been able to get it to work
On the parent page in the web browser, there is a button. When a user clicks on the button, it opens a page with a RadGrid in a RadWindow. We will call that WindowA.
In the RadGrid in WindowA, each record has a column with a HyperLink. When clicking on the HyperLink, it opens a different page in another RadWindow for the user to edit and update the data for that record. We will call that WindowB.
When the user edits the data and clicks on the Update button in WindowB, it needs to do the following:
- Execute a SQL statement to update the record in the database table.
- Close WindowB.
- Refresh or Rebind the RadGrid in WindowA using the RadAjaxManager to call an ajaxRequest to show the changes in the data.
-----------------------------------------------------------------------
I was able to do something similiar between the browser window (parent) and a RadWindow where the parent has the RadGrid which gets updated after user clicks on Update button in RadWindow. But I cannot get the scenario above to work.
-----------------------------------------------------------------------
I have read the article in http://docs.telerik.com/devtools/aspnet-ajax/controls/window/how-to/calling-functions-in-windows .
When I debug through the Javascript function, I get the error " Object doesn't support property or method 'get_ContentFrame' " on the following line of code:
oWnd.get_ContentFrame().contentWindow.MyTestViewTodayRelFn();
Below is my code.
Please help me to get this to work. A working example would help alot.
Thanks!
------------------------------------------------------------------------
Update button click subroutine in code-behind for page in WindowB ( VB code)
Protected Sub rbtnUpdateOrder_Click(sender As Object, e As EventArgs) Handles rbtnUpdateOrder.Click
...
ScriptManager.RegisterStartupScript(Me, [GetType](), "mykey", "CloseAndRebind();", True)
...
End Sub
Javascript function CloseAndRebind in page in WindowB (put in <head> </head> section):
function CloseAndRebind(args) {
var oManager = GetRadWindow().BrowserWindow.GetRadWindowManager();
var oWnd = oManager.getWindowByName("Release History");
oWnd.get_ContentFrame().contentWindow.MyTestViewTodayRelFn();
alert(oWnd);
GetRadWindow().close();
}
Javascript function MyTestViewTodayRelFn in page in WindowA (put in <head> </head> section):
function MyTestViewTodayRelFn() {
alert("Called MyTestViewTodayRelFn");
}
Note: MyTestViewTodayRelFn is just a test function. Here is an example of what the actual function would be in the page for WindowA:
function refreshGridRYG(arg) {
if (!arg) {
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
}
else {
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
}
}
Sincerely,
Keith Jackson