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

RadWindow RestrictionZoneID and Modal.

1 Answer 220 Views
Window
This is a migrated thread and some comments may be shown as answers.
Abhijit Shetty
Top achievements
Rank 2
Abhijit Shetty asked on 22 May 2012, 09:52 AM
Hi,

I have 2 questions regarding RestrictionZoneId and modal which are inter related to each other.
  1. Can i set RestrictionZoneId of a RadWindow to another RadWindows' Id. If not is there any alternative to achieve this via code?
  2. If i set RestrictionZoneId of a RadWindow to a div then can i set it to modal only for the div and not for the entire page.

Will appreciate your quick response.

1 Answer, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 24 May 2012, 04:10 PM
Hello Abhijit,

The restriction zone of a RadWindow must be a static element on the page that has explicit dimensions st in pixels. This means that another RadWindow cannot be a restricion zone because it is a movable and resizable object.

By design if a window is modal, the page should be not accessible and having modality only for part of the page defies this idea. This means we will not change the source code of RadWindow but here is some JavaScript which I prepared for you which achieves what you want:
<script type="text/javascript">
    var flag = false;
    function OnClientShow(sender, args)
    {
        if (!flag)
        {
            var overlay = sender._modalExtender._backgroundElement;
            var zoneBounds = $telerik.getBounds($get("zone"));
            sender._modalExtender._attachWindowHandlers(false);
            overlay.style.width = zoneBounds.width + "px";
            overlay.style.height = zoneBounds.height + "px";
            overlay.style.position = "";
            $get("zone").appendChild(overlay);
        }
    
    
</script>
<div id="zone" style="width: 500px; height: 500px; border: solid 1px red">
</div>
<telerik:RadWindow ID="wnd" runat="server" RestrictionZoneID="zone" VisibleOnPageLoad="true"
    OnClientShow="OnClientShow" Modal="true">
</telerik:RadWindow>



All the best,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Window
Asked by
Abhijit Shetty
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Share this question
or