Hi Guys hope someone can help, i know this is covered in another thread but im having an issue with the radwindow and rebinding the grid on my parent page.
I have a RadWindow that i open when i click a button on the ParentPage, the window opens as a modal window i am using thos to have a document upload on the new window. Once the document is uploaded i want the user to be able to click a close button on the radwindow and this close the window and rebind my grid on my parent page.
When my radWindow opens it is modal as the background is greyed out,once i have uploaded a document when i click my close button which is Button1 in this case , the window closes rebinds the grid as i want it to but then the radwindow opens again but not in a modal state and i am unable to close it.
Javascript on my parent page is
Javascript in my radwindow page is
Then the VB in my Radwindow Page is
Hope you can help
Thanks
I have a RadWindow that i open when i click a button on the ParentPage, the window opens as a modal window i am using thos to have a document upload on the new window. Once the document is uploaded i want the user to be able to click a close button on the radwindow and this close the window and rebind my grid on my parent page.
When my radWindow opens it is modal as the background is greyed out,once i have uploaded a document when i click my close button which is Button1 in this case , the window closes rebinds the grid as i want it to but then the radwindow opens again but not in a modal state and i am unable to close it.
Javascript on my parent page is
<
script
type
=
"text/javascript"
>
function openWin() {
var value = '<%=MeetingID %>';
var oWnd = radopen("DocumentUpload.aspx?MeetingID=" + value, "WindowDocumentUpload");
}
function getRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow;
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return oWindow;
}
function refreshGrid(arg) {
if (!arg) {
$find("<%= RadAjaxManagerCreateMeeting.ClientID %>").ajaxRequest("Rebind");
}
else {
$find("<%= RadAjaxManagerCreateMeeting.ClientID %>").ajaxRequest("RebindAndNavigate");
}
}
function OnClientFileOpen(oExplorer, args) {
//get the extension of the opened item
// var item = args.get_item();
// var fileExt = args.get_item().get_extension();
// if (fileExt == "xlsx" || fileExt == "docx") {
// args.set_cancel(true);
// var requestImage = "FileSystemHandler.ashx?path=" + item.get_url();
// document.location = requestImage;
// }
//if (fileExt && fileExt.toLowerCase() == "pdf") {
//cancel the default behavior
args.set_cancel(true);
//open new RadWindow
var oWnd = radopen(args.get_item().get_path(), "RadWindow1");
//set size to the newly opened RadWindow
oWnd.center;
oWnd.setSize(850, 500);
//if you want to open the PDF file in a new browser window
//you can use the following code
//window.open(args.get_item().get_path());
// }
}
</
script
>
Javascript in my radwindow page is
<
script
type
=
"text/javascript"
>
function CloseAndRebind(args) {
GetRadWindow().BrowserWindow.refreshGrid(args);
GetRadWindow().close();
}
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
return oWindow;
}
function CancelEdit() {
GetRadWindow().close();
}
</
script
>
Then the VB in my Radwindow Page is
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", True)
End Sub
Hope you can help
Thanks