This is a migrated thread and some comments may be shown as answers.

RadWindow inside of RadDock

5 Answers 82 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 2
Sean asked on 16 Aug 2011, 11:15 PM
Hi Telerik,

I am messing around with some proof of concept stuff and I was wondering if it possible to treat a RadWindow as a RadDock such that it is dockable, or store the RadWindow inside of the RadDock in such a way that a Silverlight control would be able to run inside of the RadWindow.

Ideally, the RadWindow would not be visible, only the content inside of it is visible. Really, what I want is a TargetURL for a RadDock.

Is something along these lines possible? I've got the window open with our silverlight running inside of it, but it's not pinned to the dock.

Sean

5 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 18 Aug 2011, 01:59 PM
Hi Sean,

The RadWindow provides the MinimizeZoneID property which allows it to be "docked" in a certain element when it is minimized. It also has the RestrictionZoneID property which will confine its movement in the provided element. More information on the available properties can be found in this help article. These properties can also be set dynamically via JavaScript by using its client-side API.

As for putting a RadWindow in a RadDock - this is a rather pointless task, as both are popup controls and their content tends to be rendered as a direct child of the form element and not in the exact spot in the markup where it has been declared.

If you want to place an entire html page in a RadDock I would advise that you simply put an iframe in its content template as you can freely modify it via JavaScript. Well. adding the runat="server" attribute may help in some scenarios, too.

  I believe I should warn you about one Silverlight issue - when it is moved in the DOM (which is what the RadDock will do when it is docked/undocked) or when styles such as overflow or display of its parent are changed (which is what the RadWindow does in some scenarios) the Silverlight app tends to restart. There is a workaround for this in RadWindow, but the case of the RadDock is more complex and you are likely to experience difficulties with it.

Generally speaking - moving a Silverlight about in the page is quite a cumbersome task and it is not always possible to achieve smooth operation.


Kind regards,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Sean
Top achievements
Rank 2
answered on 18 Aug 2011, 05:49 PM
Hi Marin,

Thank you for your detailed response.

Indeed, I had played around with Silverlight controls loaded into a RadDock many months ago and noticed this curious behavior. This is why I was asking the question in the first place :) It seemed to me that I could move a RadWindow around with it's target URL being a Silverlight page. Since I was able to move that around, I thought I might be able to extend this to placing the RadWindow inside of a RadDock in order to bypass the issue of loading a Silverlight control directly into the RadDock.

It sounds like my best bet is to place an IFrame inside of the RadDock's ContentTemplate and then find a way to load the page into that IFrame. Would this procedure be similar to that of setting the URL for the RadWindow? 

Regards,

Sean
0
Marin Bratanov
Telerik team
answered on 19 Aug 2011, 04:36 PM
Hello Sean,

You can set the iframe's src attribute via JavaScript quite easily to a page that loads the silverlight component, for example:
$get("theIframe").src="page_with_silverlight.aspx";

where theIframe is the id of the iframe you have placed in the RadDock. If you do not put the runat="server" attribute its ID will remain the same and will not be changed by the RadDock's Container.

The reason I suggested the RestrictionZoneID property of the RadWindow is that with it you can rather easily make it mimic the RadDock - On ClientDragStart you remove the restriction, on client drag end you check the coordinates and determine which zone should be the new restriction zone, move it to its top left corner, set it as restriction zone, set its size to the size of the zone. You would need to have disabled the Maximize behavior for this to work, of course. And we could make it so that the Silverlight does not restart in the RadWindow. Let me know if you would like to go this way so that I can send you the silverlight workaround.

Regards,
Marin
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Sean
Top achievements
Rank 2
answered on 19 Aug 2011, 05:22 PM
Hi Marin,

Give me a week or so and I'll get back to you. I can't get to this today and I'm away on a business trip next week. I need to take a look at the dependencies my project has to be able to see if I can make RadWindow work. It'd be sweet if so, though! I might even be able to replace all my RadDocks with RadWindows to keep things cleaner.

Sean
0
Marin Bratanov
Telerik team
answered on 23 Aug 2011, 08:38 AM
Hello Sean,

Take your own time and do what you need first.

  I would generally advise against such a global replacement, as the implementation I suggested is not the designed purpose of the RadWindow, it is rather a workaround. The RadDock has this functionality built-in and if you have found it applicable for your scenarios perhaps it is better than the RadWindow for the purpose. This is also your decision, though, and it is up to you to choose whether this workaround for the Silverlight app is a good way to go, as it will otherwise be unneeded.


Best wishes,
Marin
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Dock
Asked by
Sean
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Sean
Top achievements
Rank 2
Share this question
or