# The Autosize Feature of the Built-in Dialogs is Enabled

As of Q3 2013, the size of **RadEditor** dialogs is calculated via the [Autosize feature](https://demos.telerik.com/aspnet-ajax/window/examples/autosize/defaultcs.aspx) of the **RadWindow** controls.

Since the Q3 2013 release, you can no longer set a custom size for the built-in dialogs using the **DialogDefinitions**	class. For more information, see the "How to set a custom size for a dialog" section below.

## Why Is This Change Necessary?

Telerik is changing how **RadEditor** dialogs resize for several reasons:

* More consistent layout across the major browsers
* Correct behavior and layout when different skins are being used
* Improvement in the usability of the dialogs
* Fixes, related to cross-browser issues.

## How to Set a Custom Size for a Built-in Dialog

### Programmatic approach

The example below shows how to resize the RadEditor's ImageProperties, SetLinkProperties and LinkManager dialogs:

```ASP.NET
<script> 
    function OnClientCommandExecuting(editor, args) {
        if (editor.get_dialogOpener()) {
            var commandName = args.get_commandName();
            console.log(commandName)
            if (editor.get_dialogOpener()._getDialogContainer) {
                dialogReference = editor.get_dialogOpener()._getDialogContainer(commandName);
                setTimeout(function () {
                    if (commandName == "SetImageProperties") {
                        editor.get_dialogOpener()._getDialogContainer("ImageProperties").set_height("600px");
                        editor.get_dialogOpener()._getDialogContainer("ImageProperties").set_width("550px");
                    }
                    else if (commandName == "SetLinkProperties" || commandName == "LinkManager") {
                        editor.get_dialogOpener()._getDialogContainer("LinkManager").set_height("600px");
                        editor.get_dialogOpener()._getDialogContainer("LinkManager").set_width("550px");
                    }
                }, 2000);

            }
        }
    }
</script>
<telerik:RadEditor ID="RadEditor1" runat="server" ExternalDialogsPath="~/EditorDialogs" OnClientCommandExecuting="OnClientCommandExecuting">
    <Content>
        <a href="https://google.com">Google</a>
        <img src="Images/woolly-mc.png" />
        <br />
    </Content>
</telerik:RadEditor>
```

### Alternative approach

You can set a custom size for a built-in dialog using additional CSS rules in their UserControl files. You should have already used the **ExternalDialogsPath** property to customize a built-in dialog. If you are not familiar with this approach, please examine the	"[ExternalDialogsPath property](https://www.telerik.com/help/aspnet-ajax/editor-externaldialogspath-property.html)" article and the "[Editor - Customize Built-in Dialogs](https://demos.telerik.com/aspnet-ajax/editor/examples/externaldialogspath/defaultcs.aspx)" demo.

After following the steps provided in the **Customize Built-in Dialogs** demo you should implement the CSS rule. First add a `<style>` tag in the UC file. This rule should affect the body element of the document. Use a selector with higher CSS specificity than the default one and set the desired width and height attributes. For example, to resize the Document Manager you could use the following rule:

```HTML
html.redDocumentManager body 
{
	width: 580px;
	height: 832px;
}
```

You should use the correct class name according to the dialog’s name. For convenience, you could follow this pattern:

```HTML
html.red<DialogName> body
```

> note If you are using **MetroTouch** or **BlackMetroTouch** skin, you should use the following rule:

```HTML
html.red<DialogName>.RadForm_<SkinName> body
```

You can also define the CSS rules in a separate file and point the **DialogsCssFile** property of the **RadEditor** control to it.With this approach, you will not be forced to manipulate the UC files and you can easily modify the sizes of the dialogs.You can find more information about this property in the "[DialogsCssFile Property](https://www.telerik.com/help/aspnet-ajax/editor-dialogscssfile.html)" article.

## See Also

* [KB Set Custom Size for built-in dialogs of RadEditor](https://www.telerik.com/products/aspnet-ajax/documentation/knowledge-base/editor-set-custom-size-for-built-in-dialog)

* [ExternalDialogsPath Property](https://www.telerik.com/products/aspnet-ajax/documentation/controls/editor/functionality/dialogs/externaldialogspath-property)

* [Resize Dialogs](https://www.telerik.com/products/aspnet-ajax/documentation/controls/editor/functionality/dialogs/examples/resize-dialogs)

* [DialogsCssFile Property](https://www.telerik.com/products/aspnet-ajax/documentation/controls/editor/appearance-and-styling/dialogscssfile-property)

* [Demo: Editor - Customize Built-in Dialogs](https://demos.telerik.com/aspnet-ajax/editor/examples/externaldialogspath/defaultcs.aspx)

* [Demo: Window - Automatic Size Adjustment](https://demos.telerik.com/aspnet-ajax/window/examples/autosize/defaultcs.aspx)
