I've seen many posts that are similar to my issue but none of the suggestions work in my specific case. I've already seen topics such as this one (http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=grid) and this one (http://www.telerik.com/help/aspnet-ajax/window-programming-calling-functions.html), however both of those solutions seem to be for when you are refreshing the entire page, not a Parent RadWindow from a Child RadWindow.
I have a master page that opens a RadWindow with a RadGrid. This RadWindow is dynamically added so I do not know the sepecific ID because there might be other RadWindows that are open from the master page. There is also a button on that page that executes code behind, then based on certain criteria, it opens another RadWindow through a RegisterStartupScript that calls the following JavaScript:
The original window was opened in a similar JavaScript function except it is not modal.
The modal window takes user input and stores that in a database, then closes itself using GetRadWindow().Close(); in JavaScript. I've tried to get the parent page (the first RadWindow) to either refresh or rebind the grid but all of the samples and other posts seem to not have a RadWindow within a RadWindow. The JavaScript in the Parent RadWindow is not getting called by the Child RadWindow. Below is some of the code commented out of what I've tried (it uses the same GetRadWindow() function as above:
I know that it isn't even calling the function on the Parent RadWindow because all I have it doing right now is calling alert('test'); and the alert is not coming up and the Child is not closing.
How do I call a function on a Parent RadWindow from a Child RadWindow? More importantly, how do I only refresh the Parent RadWindow from a Child RadWindow without refreshing the entire page (master page).
I have a master page that opens a RadWindow with a RadGrid. This RadWindow is dynamically added so I do not know the sepecific ID because there might be other RadWindows that are open from the master page. There is also a button on that page that executes code behind, then based on certain criteria, it opens another RadWindow through a RegisterStartupScript that calls the following JavaScript:
function GetRadWindow() {
var oWindow = null;
if (window.radWindow)
oWindow = window.radWindow;
else if (window.frameElement.radWindow)
oWindow = window.frameElement.radWindow;
return oWindow;
}
function OpenModalRadWin(args) {
if (args == null)
alert("There was no URL supplied by the code. Please contact the system administrator.");
else {
var RadWinManager = GetRadWindow().get_windowManager();
var newWin = RadWinManager.open(args);
newWin.setSize(250, 250);
newWin.set_modal(true);
setTimeout(function() { newWin.setActive(true); }, 0);
}
return false;
}
The original window was opened in a similar JavaScript function except it is not modal.
The modal window takes user input and stores that in a database, then closes itself using GetRadWindow().Close(); in JavaScript. I've tried to get the parent page (the first RadWindow) to either refresh or rebind the grid but all of the samples and other posts seem to not have a RadWindow within a RadWindow. The JavaScript in the Parent RadWindow is not getting called by the Child RadWindow. Below is some of the code commented out of what I've tried (it uses the same GetRadWindow() function as above:
function CloseWin() {
//GetRadWindow().BrowserWindow.document.RefreshGrid();
//GetRadWindow().get_contentFrame().contentWindow.RefreshGrid();
GetRadWindow().Close();
//GetRadWindow().BrowserWindow.RefreshGrid();
//__doPostBack("<%=btnCancel.UniqueID %>", "");
return true;
}
I know that it isn't even calling the function on the Parent RadWindow because all I have it doing right now is calling alert('test'); and the alert is not coming up and the Child is not closing.
How do I call a function on a Parent RadWindow from a Child RadWindow? More importantly, how do I only refresh the Parent RadWindow from a Child RadWindow without refreshing the entire page (master page).