Window angst
OK here’s the scenario. Pretty much all the records in the database have a logical key, such as the CustomerCode in Customer, UserName in UserAccount, TicketReference in Ticket and so on. So if I want to define the customer for a ticket, I have a search control on the ticket form that should be working as follows: you input the customer code into a textbox and click the search button and since the code is (or rather should be) unique, the only match is referred on the ticket.
If, on the other hand, you input e.g. the first 3 letters or so and get multiple matches for the query, a grid should be displayed on a modal popup dialog. Not a popup window as such, since popup windows are annoying and stupid, but a control like the RadWindow.
Now don’t get me wrong, I really like the RadControls, but occasionally they tend to run my nut in with their extensive client-side focus. Also, working with RadControls and the AjaxControlToolkit controls, I have found them a bit artificially restricted in functionality. I have found several requests in the Telerik forums for the ability show content within a RadWindow merely declaring the window like a panel:
<telerik:RadWindow ID="RadWindow1" runat="Server">some content here</telerik:RadWindow>
The answer to these requests remains “the RadWindow isn’t intended to be used like that, but hey here’s the handy javascript function SetContent, that allows you to set the content to whatever you want.” Yea sure, if it would actually work (which for some unfathomable reason it didn’t for me) and all this javascript business gives you hell if you want to append some server-side controls into the window.
There is of course the possibility show a page in the window with all the functionality I need, but I couldn’t sleep at night knowing that I had just wasted several roundtrips through the layers and built stupid load on the session variables and so on that it would require. Additionally, it would be ugly code and annoying to implement.
Putting RadWindow aside after a tiresome jiu jitsu duel (that took way too much of my precious time), I decided to give the AjaxControlToolkit ModalPopupExtender a go. Once again, some clever developer somewhere had decided that the popup extender is just meant to show simple dialogs such as “Are you sure you want to delete the internet?” or so. Resulting in the frustrating behaviour of the popup to hide itself whenever a postback occurs inside it. Really handy considering my scenario, where the popup shows a grid and some controls to refine the search.
The ModalPopupExtender also refused to show itself from the codebehind when it was enclosed within a RadAjaxPanel, which I really prefer over UpdatePanel because of the handy LoadingPanel functionality.
If only it had the features, RadWindow would be the preferred choice of the two, primarily for its skinning features and resizability. Sure, the control I’m after isn’t that complex and shouldn’t be that hard to code myself, but I just want to avoid developing my own controls until the very last, to take at least some of the support pressure off of my back.
Oh how I miss developing Windows Forms applications. I don’t miss deploying them, though.









Hi Timo,
My name is Georgi Tunev and I am from Telerik’s support team.
As you already read in the Telerik forum thread the idea of the RadWindow control is to replace the standard browser’s popups (e.g. opened with window.open()) and the control itself is based on an IFRAME. Just like the browser’s popups or the IFRAME, the RadWindow control is a container that displays a content page – different from the parent one. By design, to cover the same scenarios and to provide the same and even greater flexibility compared to window.open, RadWindow is heavily client-side oriented.
In the Telerik RadControls suite there are two other products that can be used in similar scenarios as the one you have – these controls are RadDock and RadToolTip (included in the RadControls “Prometheus” suite).
In your case, as you need to have a modal popup, I would suggest usiing RadToolTip “Prometheus” control. It allows you to set the content for the tooltip directly in the parent page just like you want.
You can check the product demo here – by the way today we will be releasing a new update which will be available on our site in several hours.
The current release of RadToolTip also has the Modal property, which if set to true will make the tooltip modal. I would suggest using a RadToolTip with the following properties set: ManualClose = true, Modal = true, ShowCallout = false.
Note that RadToolTip requires a TargetElement to position relative to. In case you need to center the tooltip rather than position it automatically relative to the TargetElement, you will need to use its clientside event OnClientShow to reposition.
Also, by default the tooltip expects to be shown relative to the mouse position, so in case you need to change its location programatically you need to also set RelativeTo=Element.
If you have any other questions, please let me know – I will be glad to help.
Best Regards,
Georgi Tunev
Telerik
10 points for customer service! Thanks Georgi, I’ll be giving your suggestion a go.