Change Dialog Location

2 posts, 0 answers
  1. Scott
    Scott avatar
    1 posts
    Member since:
    Sep 2013

    Posted 27 Sep 2013 Link to this post

    I am using Telerik.Web.UI version 2011.1.315.35, and the default location of the dialog is centered in the browser. I am trying to explicitly specify the startup location. I have seen an example that involved setting the "OnClientLoad" property in the code-in-front (ascx or aspx), but that Javascript method doesn't seem to be being called.

    How can I specify the startup location of the dialog?

  2. Marin Bratanov
    Marin Bratanov avatar
    3555 posts

    Posted 01 Oct 2013 Link to this post

    Hi Scott,

    Here is the code I used and it seemed to work fine for me (with your version as well):
    <asp:TextBox ID="Textbox1" runat="server" Text="mizpelled textt" />
    <telerik:RadSpell ID="RadSpell1" runat="server" OnClientLoad="OnClientLoad" ControlToCheck="Textbox1" />
    <script type="text/javascript">
        function OnClientLoad(sender, args)
            if (sender && sender.get_dialogOpener && sender.get_dialogOpener()._container)
        function setDialogPosition(sender, args)
            setTimeout(function ()
                sender.moveTo(10, 10);
            }, 0);

    If this does not work for you, you can replace the OnClientLoad handler with a pageLoad() handler (i.e. the Sys.Application.Load event) and $find() the RadSpell instance, instead of getting it as the first parameter of its own event handler.

    Marin Bratanov
    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 the blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top