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

Change Dialog Location

1 Answer 8 Views
Spell
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 27 Sep 2013, 04:41 PM
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?

Thanks,
Scott

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 01 Oct 2013, 09:39 AM
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)
            sender.get_dialogOpener()._container.add_pageLoad(setDialogPosition);
    }
    function setDialogPosition(sender, args)
    {
        setTimeout(function ()
        {
            sender.moveTo(10, 10);
        }, 0);
    }
</script>

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.

Regards,
Marin Bratanov
Telerik
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.
Tags
Spell
Asked by
Scott
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or