This is a migrated thread and some comments may be shown as answers.

RadWindow load and close problems

1 Answer 139 Views
Window
This is a migrated thread and some comments may be shown as answers.
aster
Top achievements
Rank 1
aster asked on 19 Aug 2010, 12:08 AM
Hello,

In my current project I am using the RadWindow object quite a bit and I am running into a lot of trouble with it.

One page in my project calls the RadWindow object twice. The RadWindow populate data in a radgrid and on the select command of the grid the RadWindow should close. The RadWindow is called from server side code.

The issue I have noticed is that when I first load the page and make the RadWindow call, the RadWindow page_load event gets called once, the next time I call the RadWindow object from another location on the same page, the page_load of the RadWindow triggers twice. The page_load triggers as many times as I call the RadWindow object from the page.

Combine the above with the radgrid select. If the radwindow page_load happens twice then the radgrid select happens twice. The normal behavior of select in my code is to pass the selected item to the parent page and close the RadWindow and return to the parent control. However the select of the radgrid triggers as many times as the page_load event triggers.

Could you please let me know how to handle this scenario.

Thanks!!

Below are snippets of my code.
Parent page from where the RadWindow is loaded.
<telerik:RadWindowManager runat="server" ID="WindowMgr" Skin="abc" EnableEmbeddedSkins="false"
</telerik:RadWindowManager>

Javascript on the parent page to handle the OnClientClose event.
<script type="text/javascript">
        function SetTextBoxValue(oWnd, args) {
            //check if a value is returned from the dialog           
            var arg = args.get_argument();
            if (arg) {
                //do something
            }
        }
</script>

Code to invoke the RadWindow server side
Dim popUp As Telerik.Web.UI.RadWindow = New Telerik.Web.UI.RadWindow()
popUp.ID = "selectOrg"
popUp.OnClientClose = "SetTextBoxValue"
popUp.NavigateUrl = "someurl"
popUp.VisibleOnPageLoad = True
popUp.EnableEmbeddedSkins = False
popUp.Skin = "abc"
popUp.VisibleStatusbar = False
popUp.VisibleTitlebar = False
popUp.Modal = True
popUp.Behaviors = Telerik.Web.UI.WindowBehaviors.None
popUp.ShowContentDuringLoad = True
popUp.Height = Unit.Pixel(450)
popUp.Width = Unit.Pixel(500)
 
WindowMgr.Windows.Add(popUp)

Code in the select index changed event for the radgrid in the radwindow
ClientScript.RegisterStartupScript(Page.GetType(), "ey", "returnToParent('" + strSomeValue + "');", True)

Javascript code to handle the returntoParent function of the radwindow
function returnToParent(refControl) {
    //create the argument that will be returned to the parent page
    var oArg = new Object();
 
    //get the control to modify on Parent
    oArg.ControlToModify = refControl
 
    //get a reference to the current RadWindow
    var oWnd = GetRadWindow();
 
    //Close the RadWindow and send the argument to the parent page
    if (oArg.ControlToModify) {
        oWnd.close(oArg);
    }
}

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 24 Aug 2010, 09:44 AM
Hello Aster,

Try setting ShowContentDuringLoad to false and ReloadOnShow to true for the RadWindow or the RadWindowManager that you are using. If this doesn't help, please open a support ticket and send us a sample project that reproduces your exact setup and the problem itself so we can investigate further.

Sincerely yours,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Window
Asked by
aster
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or