The provided information is not enough to completely understand the setup and the problem.
One possible reason for such a problem is that the controls in the RadControls for ASP.NET AJAX suite are built upon the MS AJAX framework and the framework itself creates its controls (including RadWindow) in the Sys.Application.add_init() method.
Here is how the client events are fired in the page life cycle:
window.onload -> Sys.Application.init -> Sys.Application.load
You can see that the client object representation of MS AJAX controls are created just as the last code on the page in the Sys.Application.init event, which is raised after the window.onload event.
That is why when you call your code in window.onload by registering the client script, the RadWindow will still not be created on the page and you will get an error. To avoid this problem, you can either execute your code with a small timeout, or use the Sys.Application.add_load method.
You can find additional information about this here:
In case you need further assistance, please prepare a fully runnable simple reproduction demo along with detailed reproduction instructions, open a new support ticket and send it to us and we will modify it in order to meet your requirements so that you will be then able to apply the same logic in your original application.
the Telerik team