I call the window somewhat differently.
The window is a information and verification page that runs several stored procedures then the user will close it.
But on close I need to run Gridview1.DataBind();
and java is a foreign language to me.
7 Answers, 1 is accepted
One approach is to add RadAjaxManager on page so that you can call the AjaxRequest from "OnClientClose" event of RadWindow. Then it is possible to rebind the RadGrid from server side, inside the "RadAjaxManager1_AjaxRequest" method. Here is the sample code snippet to achieve this.
Another approach is to hook OnClientClose to the RadWindow and rebind the grid.
After a few syntax corrections I was able to get your example to run without errors.
However Gridview1 is no longer Visible on page load.
I'll start off by pointing out that Resize is not a supported option for the InitialBehaviors property. The available options are explained in this help article: http://www.telerik.com/help/aspnet-ajax/window-behavior-initial-window-state.html.
As for the GridView not being visible - I cannot find a reason for this in your code, so I would advise that you examine your CSS rules for display changes regarding table elements. Please also make sure that your datasource returns data so that the grid has something to show in the first place. Is this behavior observed only when the RadAjaxManager is used or without it as well? Can you reproduce it with a simple Update Panel? If so then the issue stems from something else in your logic that is not related to the RadControls.
I would also advise that you examine the following online demo which is very similar to your scenario, but uses a RadGrid: http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window.
the Telerik team
The gridview not showing is because of
telerik:AjaxUpdatedControl ControlID="GridView1" />
If it is removed the grid shows. but then the databind does not fire
also the RadAjaxManager Is throwing errors in the radscript manager and the radwindow manager
Error Rendering Control - RadScriptManager1An unhandled exception has occurred.
[A]Telerik.Web.UI.RadScriptManager cannot be cast to [B]Telerik.Web.UI.RadScriptManager. Type A originates from 'Telerik.Web.UI, Version=2011.2.915.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4' in the context 'LoadNeither' at location 'C:\Users\System Design\AppData\Local\Microsoft\VisualStudio\10.0\ProjectAssemblies\u9arrfu_01\telerik.web.ui.dll'. Type B originates from 'Telerik.Web.UI, Version=2011.2.915.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4' in the context 'LoadNeither' at location 'C:\Users\System Design\AppData\Local\Microsoft\VisualStudio\10.0\ProjectAssemblies\e-irpyg-01\Telerik.Web.UI.dll'.
RadWindowManager - RadWindowManager1There was an error rendering the control.
Check to make sure all properties are valid.
On the error thrown by the designer I advise that you examine the following help article: http://www.telerik.com/help/aspnet-ajax/introduction-design-time-troubleshooting.html and more precisely its last seciont which describes the exact error message you are having.
On the matter of the grid that is not rendered - I advise that you start building your project on top of the demo I previously linked. You can find it in the LiveDemos folder in your RadControls installation. Once you open the solution you can examine and modify the code freely. Once you achieve the desired functionality you can incorporate it in your actual project. I also advise that you check for the presence of the AjaxControlToolkit assembly - if it is in the Bin folder some of the MS AJAX scripts get referenced from it and these versions are somehow modified and do not work properly. You can also try the approach with the hidden button and the regular update panel.
All the best,
the Telerik team
This PC has never had the trial version installed and it runs visual studio 2010 on windows7 64bit.
There are no Ajax links in the bin folder (see attached)
I am looking to add radwindow to a bunch of solutions already existing with some very complex Gridviews.
So reworking them in radgrid is not a attractive option.
On the design time error please examine this forum thread. It is related to an older version of the RadControls for ASP.NET AJAX, yet if you have had it installed while working with this project this may still be applicable.
This design time error is caused by having two instances of the Telerik.Web.UI assembly having different versions, loaded in the same Visual Studio AppDomain.
Besides the problem, described in the article, this could happen as a result of a reference update, e.g: a page with RadControls was loaded in design mode, the reference was updated and the page got reloaded again. This is a one-time only problem and its fix involves a Visual Studio restart.
Another possible reason for that is that the solution contains multiple projects, each referencing a different RadControls for ASP.NET AJAX assembly. Thus, loading a page with a RadControl from ProjectA in design mode and loading a page with a RadControl from ProjectB could result in the TypeCastException.
In that case I would suggest that you either update both the projects to use the same RadControls assembly, or split the projects to different solutions. Please, restart Visual Studio after any of the approaches.
On the matter with the GridView - please make sure if the GridView renders at all in the page. You can do so by examining the rendered HTML with a tool like firebug or the IE Dev Toolbar. It is possible that some of the containers have specific height set or have their height set as 100% and are, therefore invisible because of some inherited size properties. You can confirm this via the UpdatePanelHeight property of the AjaxUpdatedControl inner tag. Try setting it to 100% or to some hard value in pixels. If this starts showing the GridView please examine the DOM tree for missing sizes and set them accordingly.
What I meant for the Demos was that you can start off with this runnable page and replace the RadGrid with your GridView (of course, the code-behind needs to be altered a bit to accommodate the different events from the GridView that will add the client-side handler, which opens the RadWindow). Once this project runs as expected the same settings should be applicable for your original project as well.
All the best,
the Telerik team