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

prevent RadConfirm from moving outside the page

1 Answer 102 Views
Window
This is a migrated thread and some comments may be shown as answers.
Savidu
Top achievements
Rank 1
Savidu asked on 05 Jul 2012, 10:23 AM
Hi

I have created a custom template for the radwindows radconfirm dialogue as follows

<telerik:RadWindowManager ID="RadWindowManager2" runat="server" VisibleTitlebar="false" MaxHeight="50px" KeepInScreenBounds="true " Behaviors="None" Skin="Telerik">
        <ConfirmTemplate >       
        <div class="rwDialogPopup radconfirm">
            <div class="rwDialogText">
                {1}
            </div>
            <div>
                <a onclick="$find('{0}').close(true);" class="rwPopupButton" href="javascript:void(0);">
                    <span class="rwOuterSpan"><span class="rwInnerSpan"><%= Localization.GetString("OKConfirm.Text", this.LocalResourceFile)%></span></span></a>
                <a onclick="$find('{0}').close(false);" class="rwPopupButton" href="javascript:void(0);">
                    <span class="rwOuterSpan"><span class="rwInnerSpan"><%= Localization.GetString("CancelConfirm.Text", this.LocalResourceFile)%></span></span></a>
            </div>
        </div>
         
         
        </ConfirmTemplate>
    </telerik:RadWindowManager>
 this works fine where i get the localized text for Ok and cancel buttons.

However the issue is that the radconfirm box is draggable out of the screen area there by giveing scrolls nto the page. As show in the image.

How can i prevent this.

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 06 Jul 2012, 08:26 AM
Hi Savidu,

You cannot prevent the user from dragging an object outside of the original viewport area. You can, however, set the KeepInScreenBounds property of the RadWindowManager to true so that the RadConfirm returns in the visible viewport once the user releases the mouse button. An alternative is also to disable its Move behavior. This can be done via JavaScript after you call it because the radconfirm() function returns a RadWIndow reference, so you can do something like:
var oConfirm = radconfirm("sure?", callbackFn);
oConfirm.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close);//leaves only the Close behavior



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
Savidu
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or