5 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 04 Jul 2012, 04:43 AM
Hi Quintin,
Try the following Javascript to achieve your scenario.
JS:
Hope this helps.
Thanks,
Princy.
Try the following Javascript to achieve your scenario.
JS:
<script type=
"text/javascript"
>
function
OnClientClick()
{
var
oWnd = radopen(
"URL"
,
"RadWindow1"
);
return
false
;
}
</script>
Hope this helps.
Thanks,
Princy.
0

Quintin
Top achievements
Rank 1
answered on 04 Jul 2012, 05:18 AM
Thanks for the reply Princy.
The RadWindow I am trying to open is defined on the parent page and contains a contenttemplate. I need to specifically open the instance defined on the parent page and not a new RadWindow with a URL.
I tried this from server side but the window does not display unless I set VisibleOnPageLoad = true but then the page continuously displays on postback:
Thanks!
The RadWindow I am trying to open is defined on the parent page and contains a contenttemplate. I need to specifically open the instance defined on the parent page and not a new RadWindow with a URL.
I tried this from server side but the window does not display unless I set VisibleOnPageLoad = true but then the page continuously displays on postback:
RadWindow radWin = (RadWindow)this.Parent.FindControl("winListings");
newOrderWindowManager.Windows.Add(radWin);
Thanks!
0
rdmptn
Top achievements
Rank 1
answered on 04 Jul 2012, 07:45 AM
Why don't you just use JavaScript to open it then? Instead of setting its VisibleOnPageLoad property to true you should employ the approach from this thread:http://www.telerik.com/community/forums/aspnet-ajax/window/opening-radwindow-from-the-server.aspx. Once you access the control from the code-behind you can use its ClientID property.
An alternative is to add the OnClientClick script from the code-behind, something like :
An alternative is to add the OnClientClick script from the code-behind, something like :
RadWindow myRW = ....;
//get your RadWIndow here by traversing the control tree
myButton.OnClientClick =
"$find('"
+ myRW.ClientID +
"').show(); return false;"
;
0

Quintin
Top achievements
Rank 1
answered on 04 Jul 2012, 11:50 AM
Thanks, that may work. I guess my question is how do I go about traversing the parent controls?
0
rdmptn
Top achievements
Rank 1
answered on 06 Jul 2012, 07:48 AM
Just like you did in your previous post? I mean this line:
RadWindow radWin = (RadWindow)
this
.Parent.FindControl(
"winListings"
);
//and then you need
radWin.ClientID