I have two pages one is the main with open another that is a RadWindow, at RadWindow have a Treeview, I would like when each treeview node is click one code behind at first page is fired and dont´t close the RadWindow.
Thanks
1 Answer, 1 is accepted
0
Accepted
Tervel
Telerik team
answered on 30 May 2008, 04:17 PM
Hello Paulo,
Your scenario is not possible to implement in the way you want it.
The rad window control is not a separate browser window. It is a DHTML control that resides on the main page (that is, the page which you want to reload every time a tree node in the rad window is clicked). Of course, reloading the main page will cause the rad window to be destroyed as well - as it is a part of this page.
However, it is possible to implement what you need by using AJAX and just a line or two of client-side code to start the AJAX request. AJAX requests perform partial, rather than complete page updates, and it is very easy to use with Telerik RadControls.
Here is one possible way for you to proceed:
1. Wrap your page content (except the RadWindow/RadWindowManager declaration) into a <asp:UpdatePanel>
2. Add a hidden button into this panel, which you will use to make a programmatic AJAX request to the server. To hide the button you should add it to a hidden DIV, e.g.
<div style="display:none">
<asp:Button id="HiddenButton" ..../>
</div>
4. Once you have returned the value from the treeview node and have set it into a hidden field, you are ready to perform the partial page update request. All you need to do is call the client-side click() method of the Button, e.g.
<script>
//Perhaps this code is inside of some client-side function
var button = document.getElementById("<%=HiddenButton.ClientID%>");
button.click();
</script>